From patchwork Sun Oct 3 06:53:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: INAGAKI Hiroshi X-Patchwork-Id: 1535738 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=lYxN54E+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=BqCQ1VHD; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HMZTD5hZLz9t0k for ; Sun, 3 Oct 2021 17:59:12 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f29yVKNagGFtMheYoG0drzcVhtL6iF0u+nTrkAMnCSI=; b=lYxN54E+3xdApV vfbRJBzinb3bbA9+AIjzf/OeYuEJS6AaspDNpOQ0FB1x+pypQyFhJpw8Ze6WzBmPxSY0McRp0CDLT qcmcUsnDfu4EgiALm2T7o6hh5DwkMCa2Q7isOSYyJ+DITDcrnMOuOGMwMrxaRsPyjZOH3YFuZSpm4 7eXo9VIekD2Y8lmaLHVnPEQNpZ9yBFvD4igpoHT3pei/oBr2N2H7Spu7Sk8Vh7EddXNAWsL3Xw473 Tg7yQOmiWIJHr/fb+1cGRLDs0JnFJ8YjECddBDf1Hs5YB+PxnEslGLspCG2z741m8gNImjkziQFwF wYvIp8FR49979Ot1VRTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWvOi-003ILf-TT; Sun, 03 Oct 2021 06:54:57 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWvOF-003II4-B0 for openwrt-devel@lists.openwrt.org; Sun, 03 Oct 2021 06:54:29 +0000 Received: by mail-pj1-x1033.google.com with SMTP id r7so9311001pjo.3 for ; Sat, 02 Oct 2021 23:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yqX5cloWafgUsgnxGfhidXEGqZgz2E37ugaDc36tJZQ=; b=BqCQ1VHD7AlvPW5Ea+/97I8AwEXsjlrw+YEN1vpVLnWXdsxhylQjPUi79xyyYus+aR 6ohifEItk30nOTRtyA2gbc9cuiSCiwy89HIJMR3QsEwTz/sOmVm3yrnzhIP08MywaZlU 8rvDQJV0o35h8nHtIqlyYwIn3Ma53C9+wCK0ANisF7EhYmsCzXIHZUvpTEV3QccguKX9 BGm7x68aSW/ueRpIt8cBham8LcKHET9BCr79ITtFOgEwihr0qSSuJYhiIlY8qETlEOE2 ZtwhsGXLV8K6mEt24ZiWxUFnF8Hr6gDsviJlf+eGgVhQdsmepUi3PZvtAhmEIHFk2Hus u8eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yqX5cloWafgUsgnxGfhidXEGqZgz2E37ugaDc36tJZQ=; b=UZuLx8E6DGQORfANfHHPttF1dFSDhJDuUSnSCFOQaid5mNuBtKBnDxSJcQ7DNYXJUq ZBzqk7It3BX/QKkIWt4evlYx5WYZ3aFZHu7AA4oEo7J3jPGZf6r7eJdtGRvQMq71tkvI J+1Ls3v6H4F80YIk/fS0Io3KY5Y7th9joUSsBwths6fEJ/JcV6CfH+1qytaZx6zAfqri Ud02nvZnZVW4nD5OmPA6ugz+4o7Qd77nvSXm0+Q7rufklGpMJzrK2KF9/J+PSChtLe8t vq/6yi8QKlskKRREFAMpXtOB0RlUA8w12bDVg5yIL28LqaB726Igvi2Dao3laWyzcMhY u7zw== X-Gm-Message-State: AOAM5332T+PdKqFb2F4g41GEkjSpUQ7Y9CBKpe0xcI1CpAuY6J9ifCSY 4tL/bEcx+PE7DvCjJfHx2GZCMluPbhI= X-Google-Smtp-Source: ABdhPJxyWYolfPNL/z0EJAtZOBQMP5vO1KIMStPI/rVfExLUUcQ59NnWmbaX3glr0cXzIcZHAtcqUg== X-Received: by 2002:a17:90a:1942:: with SMTP id 2mr29819003pjh.195.1633244064972; Sat, 02 Oct 2021 23:54:24 -0700 (PDT) Received: from localhost.localdomain ([240b:12:500:6500:2014:3ca1:3cc:a40f]) by smtp.gmail.com with ESMTPSA id e10sm635554pfd.174.2021.10.02.23.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 23:54:24 -0700 (PDT) From: INAGAKI Hiroshi To: openwrt-devel@lists.openwrt.org Cc: INAGAKI Hiroshi Subject: [PATCH 1/3] realtek: enable pca953x driver for target Date: Sun, 3 Oct 2021 15:53:47 +0900 Message-Id: <20211003065350.1437-2-musashino.open@gmail.com> X-Mailer: git-send-email 2.33.0.windows.2 In-Reply-To: <20211003065350.1437-1-musashino.open@gmail.com> References: <20211003065350.1437-1-musashino.open@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211002_235427_403637_1F0168D0 X-CRM114-Status: GOOD ( 10.92 ) X-Spam-Score: -0.2 (/) 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: The system status LED on Panasonic Switch-M8eG PN28080K is connected to a PCA9539PW. To use the LED as a status LED of OpenWrt while booting, enable the pca953x driver and built-in to the kernel. Signed-off-by: INAGAKI Hiroshi --- target/linux/realtek/config-5.10 | 3 +++ target/linux/realtek/config-5.4 | 3 +++ 2 files changed, 6 insertions(+) Content analysis details: (-0.2 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 -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1033 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [musashino.open[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 The system status LED on Panasonic Switch-M8eG PN28080K is connected to a PCA9539PW. To use the LED as a status LED of OpenWrt while booting, enable the pca953x driver and built-in to the kernel. Signed-off-by: INAGAKI Hiroshi --- target/linux/realtek/config-5.10 | 3 +++ target/linux/realtek/config-5.4 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/target/linux/realtek/config-5.10 b/target/linux/realtek/config-5.10 index 1b050fc081..810bacbefa 100644 --- a/target/linux/realtek/config-5.10 +++ b/target/linux/realtek/config-5.10 @@ -69,6 +69,8 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_PCA953X=y +# CONFIG_GPIO_PCA953X_IRQ is not set CONFIG_GPIO_REALTEK_OTTO=y CONFIG_GPIO_RTL8231=y CONFIG_GRO_CELLS=y @@ -161,6 +163,7 @@ CONFIG_RATIONAL=y CONFIG_REALTEK_PHY=y CONFIG_REALTEK_SOC_PHY=y CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y CONFIG_RTL838X=y diff --git a/target/linux/realtek/config-5.4 b/target/linux/realtek/config-5.4 index 5e29879798..8a353dfc32 100644 --- a/target/linux/realtek/config-5.4 +++ b/target/linux/realtek/config-5.4 @@ -72,6 +72,8 @@ CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y +CONFIG_GPIO_PCA953X=y +# CONFIG_GPIO_PCA953X_IRQ is not set CONFIG_GPIO_RTL8231=y CONFIG_GPIO_RTL838X=y CONFIG_REALTEK_SOC_PHY=y @@ -161,6 +163,7 @@ CONFIG_POWER_RESET_SYSCON=y CONFIG_PSB6970_PHY=y CONFIG_REALTEK_PHY=y CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y CONFIG_RTL838X=y From patchwork Sun Oct 3 06:53:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: INAGAKI Hiroshi X-Patchwork-Id: 1535737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=Vp9WTuCP; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=mazNJmWc; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HMZTC37J2z9t0k for ; Sun, 3 Oct 2021 17:59:11 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KjrFX2947QDFejqVZb6zTdk1Wsp9NobRHCFR3mxeYkE=; b=Vp9WTuCP41bQGN K3RD4iUvEJqzCC18ar9qH2I+DfthPGdppmQMVzLUPGtcoPFoekaCHdE/k60H14lFoh52uw8FskeWG mhv+692r36a/MXhh83G+Zbe1l2fEo+iNy77hzINdnToMzHs/nXhx+PwGmu2sXGXZwz1fduzV8WMGP SaIRtgu/P2kPzIu6CU4U8FtXAV6GqzOkCxyz3BQ+pmq8y36tLnEQwgdT6uLeaFUOj01zpexfT1fkJ Gb/zE8+zKwdvOcSsPA1EuJeb5aI1oshpuwJlh9Em2AmAo7YChgnpgbG/1hrSzp3cLiIK0lMJKDNyo 4LGge6FczUryiSaBvEpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWvOK-003IJQ-O7; Sun, 03 Oct 2021 06:54:32 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWvOF-003IID-4o for openwrt-devel@lists.openwrt.org; Sun, 03 Oct 2021 06:54:28 +0000 Received: by mail-pl1-x631.google.com with SMTP id j15so9006164plh.7 for ; Sat, 02 Oct 2021 23:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JA6kpiiexH3zov1eEllwP0XQc+2DXDiSGUxBRVWhU2k=; b=mazNJmWc6VRD35aK93u1FDCzh9tTorNoFMnVkM1pX+Ik58X+WMip8L6uIDqDzHtqZ9 0lfG9oDT+dwoXCqp3TY8mW9Whr9EdYfCCE8VPrKdRbJv6Dln9pmbCNtihXJcEqM3KACa dhSyT7I/XaWDTayR4FnVVE0oyb+FLZ8Xrpmz9qDJpa6OlBbf+ALHw+C0SXUKeEk/f36y Au6/b7u9ovHKrg+NmaWHuvcg80I306Pyk3DRzN/VnV17QghBI5wJqiLMu6quGGgyzm58 KAD0U8LtSURi20vLNhXQdwIFioLirBl4C8tZZuofxdlotRJS4CZb1SaRE/ycSDLeSfXI 7w+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JA6kpiiexH3zov1eEllwP0XQc+2DXDiSGUxBRVWhU2k=; b=qLtOXD6dQVXSAMQzlnm5HGXoDRCzhopTPekT5INPIL9UNtlVhtP37DniS0G+PF0Pdu zDhq/vgkW85UCTnDPD1r0J2lqeTNy3N/ya+TRp6ctBdVWV7OciZEgsxEzMZpFPy0dRgZ ONmJmkg5CKVg0dC6HFS/6m2vgvqwxUP26oHjptuQnxH9M9aL5g+hYK/kOGTpJLSPUc/K W8IMtJs/h6EG5o87qvY+lCh8rzK0x1TdLU911syR02HMTzFTIZBX1pxG3ufX54uoJIvJ f6rhUzVQyQbjOM8iQo0nSZHjQrWX3D9qY91fEtrxjz7ShjE0MUuCdTyUYK4DsSSQ189v 2Tzw== X-Gm-Message-State: AOAM530ODXyM8hOa3RYRCUkeLY+j+ctLgQzc/hGg42MhZkwzISJbiCC9 /9SNUd4k3/Vj796+rJJWKlai8ZDRLjI= X-Google-Smtp-Source: ABdhPJyzY7D0nb8JU8ewDSSmeT5yaj4RxpPQAYcJDsaJWxkokh98EoDCZKqzB8rHoJhQD1CL0AzO7w== X-Received: by 2002:a17:90b:4f4d:: with SMTP id pj13mr29952531pjb.47.1633244066276; Sat, 02 Oct 2021 23:54:26 -0700 (PDT) Received: from localhost.localdomain ([240b:12:500:6500:2014:3ca1:3cc:a40f]) by smtp.gmail.com with ESMTPSA id e10sm635554pfd.174.2021.10.02.23.54.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 23:54:25 -0700 (PDT) From: INAGAKI Hiroshi To: openwrt-devel@lists.openwrt.org Cc: INAGAKI Hiroshi Subject: [PATCH 2/3] realtek: enable gpio-restart driver in target Date: Sun, 3 Oct 2021 15:53:48 +0900 Message-Id: <20211003065350.1437-3-musashino.open@gmail.com> X-Mailer: git-send-email 2.33.0.windows.2 In-Reply-To: <20211003065350.1437-1-musashino.open@gmail.com> References: <20211003065350.1437-1-musashino.open@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211002_235427_206155_EC51D6E3 X-CRM114-Status: GOOD ( 10.13 ) X-Spam-Score: -0.2 (/) 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: On Panasonic Switch-M8eG PN28080K, a GPIO pin on PCA9539 chip is used for for hard-reset of the system. To use this, enable gpio-restart driver and built-in to the kernel. Signed-off-by: INAGAKI Hiroshi --- target/linux/realtek/config-5.10 | 1 + target/linux/realtek/config-5.4 | 1 + 2 files changed, 2 insertions(+) Content analysis details: (-0.2 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 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [musashino.open[at]gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:631 listed in] [list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 On Panasonic Switch-M8eG PN28080K, a GPIO pin on PCA9539 chip is used for for hard-reset of the system. To use this, enable gpio-restart driver and built-in to the kernel. Signed-off-by: INAGAKI Hiroshi --- target/linux/realtek/config-5.10 | 1 + target/linux/realtek/config-5.4 | 1 + 2 files changed, 2 insertions(+) diff --git a/target/linux/realtek/config-5.10 b/target/linux/realtek/config-5.10 index 810bacbefa..5a847a2bb1 100644 --- a/target/linux/realtek/config-5.10 +++ b/target/linux/realtek/config-5.10 @@ -158,6 +158,7 @@ CONFIG_PHYLIB=y CONFIG_PHYLINK=y CONFIG_PINCTRL=y CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_POWER_RESET_SYSCON=y CONFIG_RATIONAL=y CONFIG_REALTEK_PHY=y diff --git a/target/linux/realtek/config-5.4 b/target/linux/realtek/config-5.4 index 8a353dfc32..34e4b9028b 100644 --- a/target/linux/realtek/config-5.4 +++ b/target/linux/realtek/config-5.4 @@ -159,6 +159,7 @@ CONFIG_PHYLIB=y CONFIG_PHYLINK=y CONFIG_PINCTRL=y CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_POWER_RESET_SYSCON=y CONFIG_PSB6970_PHY=y CONFIG_REALTEK_PHY=y From patchwork Sun Oct 3 06:53:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: INAGAKI Hiroshi X-Patchwork-Id: 1535739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=e8kDp17v; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=C7jysiO5; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HMZTN39Zgz9t0k for ; Sun, 3 Oct 2021 17:59:20 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SDZYuHHrG1cW1Dc+8Qr1FCbytqahYYlTVBr80qYmvzw=; b=e8kDp17vd722wP gt8c9d3xHanyToMWNcJGPj6xV2auDuDXLBiPLwnfFEbaVcBCeHpgBvzj7efj6EjO3NvOqp543fBxV hcI6wFcM5IrDxe1fOKe5NsdeEgnk8Bl4luCjEvkUI0kU6u2elznPd6eArvGFY+jn+DgQPIGOf1ZbG s/ePpAVS/+PHSEk13HASswClSg5E+ME7H5PBZwNhpGgNA2e/l+moEdjteWSoLBMsxJVruyzWToum9 ohlSShJywqK+4a7tDAVja2xzhVCBnAUYMhNwDt4p/Cd5uscRsASsHweS91lLNqUcthbcjXSB9uxrW zM8Hbm2DKxb9HuYnRYfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWvOw-003INK-8q; Sun, 03 Oct 2021 06:55:10 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWvOG-003IJ1-Rb for openwrt-devel@lists.openwrt.org; Sun, 03 Oct 2021 06:54:31 +0000 Received: by mail-pg1-x529.google.com with SMTP id e7so13547134pgk.2 for ; Sat, 02 Oct 2021 23:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z3whMvl92Z4a9UBZMYJuzZEpAkeADjtC8iJ5onhkzPw=; b=C7jysiO5UlqUDhbgOkTyfpx/tzNsnjlhHz8gwjGryP17jvcnXw7+huE5FYz3GFVxT7 s4Akulp13FxtaEedtWkkMSkw8s1HgKAvSlcPynu4GrPcZ4lveVT2hDurLbWwf0LWDaN4 P5LGj0jCDVSPmtzFZBxotkwKlIGxNQ3yD+7tHG2cRnBCTf/AD7S90rNSwcCB47Locrgn dxkAwN743gMYGjIq5FwgJi1yok4SrwRdOhFxy5oNIlGPVZ3YpKfFtnDGHX7nqSnZ5PCW tYbBydjJaaRulnid1ZPWZWxMsQjrHwVedonYZ7KTNou/d50zUZtVIgrlRcWiSw8fQmR+ tUiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z3whMvl92Z4a9UBZMYJuzZEpAkeADjtC8iJ5onhkzPw=; b=2Jw/jy4z0572zexl6FFtKf8i4Ji+zLbrB1KhejgneToylxIIqTXYawzO+hvrC3SOL9 4ajQqssPGo0JZXFhFh5MxeTr0Mc4vssV7AzFbmz8PmUDDy9eaJQKCPtuJgWaBC03ksaR s5vhCLSRFiAVxG5RIMTjLKbhKL6fE9zORo4o/zrakXMdDb1MK24SDAtI02Ai+MTsLYvX y2zjdbKYppTye2SeJVF0SYuzyBbAc/OGoND9aujIm04nNc8MuXXMIKpfMd0s4pBlJvOJ C8Ohtc1nePXvED9yd80MIzGZeFYVoqqkLLCj6T9npDrmkWcirKzs8xDnHYsExEfLhnww ottw== X-Gm-Message-State: AOAM530DhbWxqcBlBv/3+gh4GuGiRZmv3IYQYv4Pk2/8VuHIZNtdPt13 FNRDIp0jGWgUrAJTBi1cIH8p8H2cqzQ= X-Google-Smtp-Source: ABdhPJyAf8DkoEPm0pD3yeMiE6tZGE/Ne7bse6cij8wxmCp174mQ9AGVPeGo+nr2lmheU8JBrcI7Hw== X-Received: by 2002:a62:2707:0:b0:44b:4870:770b with SMTP id n7-20020a622707000000b0044b4870770bmr18431109pfn.59.1633244067652; Sat, 02 Oct 2021 23:54:27 -0700 (PDT) Received: from localhost.localdomain ([240b:12:500:6500:2014:3ca1:3cc:a40f]) by smtp.gmail.com with ESMTPSA id e10sm635554pfd.174.2021.10.02.23.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 23:54:27 -0700 (PDT) From: INAGAKI Hiroshi To: openwrt-devel@lists.openwrt.org Cc: INAGAKI Hiroshi Subject: [PATCH 3/3] realtek: add support for Panasonic Switch-M8eG PN28080K Date: Sun, 3 Oct 2021 15:53:49 +0900 Message-Id: <20211003065350.1437-4-musashino.open@gmail.com> X-Mailer: git-send-email 2.33.0.windows.2 In-Reply-To: <20211003065350.1437-1-musashino.open@gmail.com> References: <20211003065350.1437-1-musashino.open@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211002_235428_931955_FE67CF25 X-CRM114-Status: GOOD ( 20.24 ) X-Spam-Score: -0.2 (/) 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: Panasonic M8eG PN28080K is a 8 + 1 port gigabit switch, based on RTL8380M. Specification: - SoC : Realtek RTL8380M - RAM : DDR3 128 MiB (Winbond W631GG8KB-15) - Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G) - Ethernet : 10/100/1000 Mbps x8 + 1 - port 1-8 : TP, RTL8218B (SoC) - port 9 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:529 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [musashino.open[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 Panasonic M8eG PN28080K is a 8 + 1 port gigabit switch, based on RTL8380M. Specification: - SoC : Realtek RTL8380M - RAM : DDR3 128 MiB (Winbond W631GG8KB-15) - Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G) - Ethernet : 10/100/1000 Mbps x8 + 1 - port 1-8 : TP, RTL8218B (SoC) - port 9 : SFP, RTL8380M (SoC) - LEDs/Keys : 7x / 1x - UART : RS-232 port on the front panel (connector: RJ-45) - 3:TX, 4:GND, 5:GND, 6:RX (pin number: RJ-45) - 9600n8 - Power : 100-240 VAC, 50/60 Hz, 0.5 A - Plug : IEC 60320-C13 - Stock OS : VxWorks based Flash instruction using initramfs image: 1. Prepare the TFTP server with the IP address 192.168.1.111 2. Rename the OpenWrt initramfs image to "0101A8C0.img" and place it to the TFTP directory 3. Download the official upgrading firmware (ex: pn28080k_v30000.rom) and place it to the TFTP directory 4. Boot M8eG and interrupt the U-Boot with Ctrl + C keys 5. Execute the following commands and boot with the OpenWrt initramfs image rtk network on tftpboot 0x81000000 bootm 6. Backup mtdblock files to the computer by scp or anything and reboot 7. Interrupt the U-Boot and execute the following commands to re-create filesystem in the flash ffsmount c:/ ffsfmt c:/ this step takes a long time, about ~ 4 mins 8. Execute the following commands to put the official images to the filesystem updatert example: updatert pn28080k_v30000.rom this step takes about ~ 40 secs 9. Set the environment variables of the U-Boot by the following commands setenv loadaddr 0xb4e00000 setenv bootcmd bootm saveenv 10: Download the OpenWrt initramfs image and boot with it tftpboot 0x81000000 0101A8C0.img bootm 11: On the initramfs image, download the sysupgrade image and perform sysupgrade with it sysupgrade 12: Wait ~ 120 seconds to complete flashing Note: - "Switch-M8eG" is a model name, and "PN28080K" is a model number. Switch-M8eG has an another (old) model number ("PN28080"), it's not a Realtek based hardware. - Switch-M8eG has a "POWER" LED (Green), but it's not connected to any GPIO pin. - The U-Boot checks the runtime images in the flash when booting and fails to execute anything in "bootcmd" variable if the images are not exsisting. - A filesystem is formed in the flash (0x100000-0x1DFFFFF) on the stock firmware and it includes the stock images, configuration files and checksum files. It's unknown format, can't be managed on the OpenWrt. To get the enough space for OpenWrt, move the filesystem to the head of "fs_reserved" partition by execution of "ffsfmt" and "updatert". Back to the stock firmware: 1. Delete "loadaddr" variable and set "bootcmd" to the original value on U-Boot: setenv loadaddr setenv bootcmd 'bootm 0x81000000' on OpenWrt: fw_setenv loadaddr fw_setenv bootcmd 'bootm 0x81000000' 2. Perform reset or reboot on U-Boot: reset on OpenWrt: reboot Signed-off-by: INAGAKI Hiroshi --- .../rtl8380_panasonic_m8eg-pn28080k.dts | 103 ++++++++ .../rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi | 216 +++++++++++++++++ .../rtl8380_panasonic_m8eg-pn28080k.dts | 107 +++++++++ .../rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi | 220 ++++++++++++++++++ target/linux/realtek/image/Makefile | 10 + 5 files changed, 656 insertions(+) create mode 100644 target/linux/realtek/dts-5.10/rtl8380_panasonic_m8eg-pn28080k.dts create mode 100644 target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi create mode 100644 target/linux/realtek/dts-5.4/rtl8380_panasonic_m8eg-pn28080k.dts create mode 100644 target/linux/realtek/dts-5.4/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi diff --git a/target/linux/realtek/dts-5.10/rtl8380_panasonic_m8eg-pn28080k.dts b/target/linux/realtek/dts-5.10/rtl8380_panasonic_m8eg-pn28080k.dts new file mode 100644 index 0000000000..df470c377e --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl8380_panasonic_m8eg-pn28080k.dts @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" +#include "rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi" + +/ { + compatible = "panasonic,m8eg-pn28080k", "realtek,rtl838x-soc"; + model = "Panasonic Switch-M8eG PN28080K"; + + aliases { + led-boot = &led_status_eco_green; + led-failsafe = &led_status_eco_amber; + led-running = &led_status_eco_green; + led-upgrade = &led_status_eco_green; + }; + + sfp0: sfp-p9 { + compatible = "sff,sfp"; + i2c-bus = <&i2c0>; + tx-fault-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; +}; + +&leds { + led_status_eco_amber: status_eco_amber { + label = "amber:status_eco"; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; + + led_status_eco_green: status_eco_green { + label = "green:status_eco"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + }; +}; + +&i2c_gpio_0 { + scl-gpios = <&gpio0 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&i2c_gpio_1 { + scl-gpios = <&gpio0 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +ðernet0 { + mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #address-cells = <1>; + #size-cells = <0>; + + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + + INTERNAL_PHY(24) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) + + port@24 { + reg = <24>; + label = "lan9"; + phy-mode = "1000base-x"; + phy-handle = <&phy24>; + managed = "in-band-status"; + sfp = <&sfp0>; + }; + + port@28 { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi b/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi new file mode 100644 index 0000000000..d41213f1fd --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi @@ -0,0 +1,216 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +/ { + chosen { + bootargs = "console=ttyS0,9600"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + leds: leds { + compatible = "gpio-leds"; + + any_collision { + label = "amber:any_col"; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + }; + + giga { + label = "green:giga"; + gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; + }; + + 100m { + label = "green:100m"; + gpios = <&gpio2 9 GPIO_ACTIVE_LOW>; + }; + + full_duplex { + label = "green:full"; + gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; + }; + + loop_history { + label = "green:loop_history"; + gpios = <&gpio2 11 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + led_mode { + label = "led-mode"; + gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-restart { + compatible = "gpio-restart"; + gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; + active-delay = <100>; + inactive-delay = <100>; + wait-delay = <3000>; + }; + + /* Switch-M*eG PN28xx0K has no RTL8231 chip */ + /delete-node/ rtl8231-gpio; + + i2c_gpio_0: i2c-gpio-0 { + compatible = "i2c-gpio"; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + + gpio1: gpio@20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio2: gpio@75 { + compatible = "nxp,pca9539"; + reg = <0x75>; + gpio-controller; + #gpio-cells = <2>; + + /* + * GPIO14 (IO1_6): Shift Register RESET (port LED) + * - Switch-M8eG PN28080K: 3x 74HC164 + * - Switch-M24eG PN28240K: 6x 74HC164 + * - Switch-M48eG PN28480K: 12x 74HC164 + */ + portled_sregister_reset { + gpio-hog; + gpios = <14 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "portled-sregister-reset"; + }; + }; + }; + + i2c_gpio_1: i2c-gpio-1 { + compatible = "i2c-gpio"; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + + i2c-switch@70 { + compatible = "nxp,pca9545"; + reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + /* + * - Switch-M8eG PN28080K: 0 (sfp p9) + * - Switch-M24eG PN28240K: 0-1 (sfp p23-p24) + * - Switch-M48eG PN28480K: 0-3 (sfp p45-p48) + */ + i2c0: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + i2c1: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + i2c2: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + i2c3: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x80000 0x10000>; + }; + + partition@90000 { + label = "u-boot-env2"; + reg = <0x90000 0x10000>; + }; + + partition@a0000 { + label = "sysinfo"; + reg = <0xa0000 0x60000>; + read-only; + }; + + /* + * 0x100000 - 0x1DFFFFF + * Filesystem area for runtime images and + * configuration files in stock firmware + */ + + /* + * re-created filesystem area, 2x stock images + * are included with checksum files + */ + partition@100000 { + label = "fs_reserved"; + reg = <0x100000 0xd00000>; + }; + + /* free area for OpenWrt */ + partition@e00000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0xe00000 0x1000000>; + }; + + partition@1e00000 { + label = "vlog_data"; + reg = <0x1e00000 0x100000>; + read-only; + }; + + partition@1f00000 { + label = "elog_data"; + reg = <0x1f00000 0x100000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/realtek/dts-5.4/rtl8380_panasonic_m8eg-pn28080k.dts b/target/linux/realtek/dts-5.4/rtl8380_panasonic_m8eg-pn28080k.dts new file mode 100644 index 0000000000..d369e52625 --- /dev/null +++ b/target/linux/realtek/dts-5.4/rtl8380_panasonic_m8eg-pn28080k.dts @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" +#include "rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi" + +/ { + compatible = "panasonic,m8eg-pn28080k", "realtek,rtl838x-soc"; + model = "Panasonic Switch-M8eG PN28080K"; + + aliases { + led-boot = &led_status_eco_green; + led-failsafe = &led_status_eco_amber; + led-running = &led_status_eco_green; + led-upgrade = &led_status_eco_green; + }; + + sfp0: sfp-p9 { + compatible = "sff,sfp"; + i2c-bus = <&i2c0>; + tx-fault-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; +}; + +&leds { + led_status_eco_amber: status_eco_amber { + label = "amber:status_eco"; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; + + led_status_eco_green: status_eco_green { + label = "green:status_eco"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + }; +}; + +&i2c_gpio_0 { + /* SoC GPIO 0 */ + scl-gpios = <&gpio0 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + /* SoC GPIO 1 */ + sda-gpios = <&gpio0 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&i2c_gpio_1 { + /* SoC GPIO 12 */ + scl-gpios = <&gpio0 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + /* SoC GPIO 13 */ + sda-gpios = <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +ðernet0 { + mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #address-cells = <1>; + #size-cells = <0>; + + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + + INTERNAL_PHY(24) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) + + port@24 { + reg = <24>; + label = "lan9"; + phy-mode = "1000base-x"; + phy-handle = <&phy24>; + managed = "in-band-status"; + sfp = <&sfp0>; + }; + + port@28 { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/realtek/dts-5.4/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi b/target/linux/realtek/dts-5.4/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi new file mode 100644 index 0000000000..3075cbe9c8 --- /dev/null +++ b/target/linux/realtek/dts-5.4/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +/ { + chosen { + bootargs = "console=ttyS0,9600"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + leds: leds { + compatible = "gpio-leds"; + + any_collision { + label = "amber:any_col"; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + }; + + giga { + label = "green:giga"; + gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; + }; + + 100m { + label = "green:100m"; + gpios = <&gpio2 9 GPIO_ACTIVE_LOW>; + }; + + full_duplex { + label = "green:full"; + gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; + }; + + loop_history { + label = "green:loop_history"; + gpios = <&gpio2 11 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + led_mode { + label = "led-mode"; + gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-restart { + compatible = "gpio-restart"; + gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; + active-delay = <100>; + inactive-delay = <100>; + wait-delay = <3000>; + }; + + /* Switch-M*eG PN28xx0K has no RTL8231 chip */ + /delete-node/ rtl8231-gpio; + + i2c_gpio_0: i2c-gpio-0 { + compatible = "i2c-gpio"; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + + gpio1: gpio@20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio2: gpio@75 { + compatible = "nxp,pca9539"; + reg = <0x75>; + gpio-controller; + #gpio-cells = <2>; + + /* + * GPIO14 (IO1_6): Shift Register RESET (port LED) + * - Switch-M8eG PN28080K: 3x 74HC164 + * - Switch-M24eG PN28240K: 6x 74HC164 + * - Switch-M48eG PN28480K: 12x 74HC164 + */ + portled_sregister_reset { + gpio-hog; + gpios = <14 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "portled-sregister-reset"; + }; + }; + }; + + i2c_gpio_1: i2c-gpio-1 { + compatible = "i2c-gpio"; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + + i2c-switch@70 { + compatible = "nxp,pca9545"; + reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + /* + * - Switch-M8eG PN28080K: 0 (sfp p9) + * - Switch-M24eG PN28240K: 0-1 (sfp p23-p24) + * - Switch-M48eG PN28480K: 0-3 (sfp p45-p48) + */ + i2c0: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + i2c1: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + i2c2: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + i2c3: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; +}; + +&gpio0 { + indirect-access-bus-id = <0>; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x80000 0x10000>; + }; + + partition@90000 { + label = "u-boot-env2"; + reg = <0x90000 0x10000>; + }; + + partition@a0000 { + label = "sysinfo"; + reg = <0xa0000 0x60000>; + read-only; + }; + + /* + * 0x100000 - 0x1DFFFFF + * Filesystem area for runtime images and + * configuration files in stock firmware + */ + + /* + * re-created filesystem area, 2x stock images + * are included with checksum files + */ + partition@100000 { + label = "fs_reserved"; + reg = <0x100000 0xd00000>; + }; + + /* free area for OpenWrt */ + partition@e00000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0xe00000 0x1000000>; + }; + + partition@1e00000 { + label = "vlog_data"; + reg = <0x1e00000 0x100000>; + read-only; + }; + + partition@1f00000 { + label = "elog_data"; + reg = <0x1f00000 0x100000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile index 5e4b4cde80..ed1e9e5212 100644 --- a/target/linux/realtek/image/Makefile +++ b/target/linux/realtek/image/Makefile @@ -112,6 +112,16 @@ define Device/netgear_gs310tp-v1 endef TARGET_DEVICES += netgear_gs310tp-v1 +define Device/panasonic_m8eg-pn28080k + SOC := rtl8380 + IMAGE_SIZE := 16384k + DEVICE_VENDOR := Panasonic + DEVICE_MODEL := Switch-M8eG + DEVICE_VARIANT := PN28080K + DEVICE_PACKAGES := kmod-i2c-mux-pca954x +endef +TARGET_DEVICES += panasonic_m8eg-pn28080k + define Device/zyxel_gs1900 SOC := rtl8380 IMAGE_SIZE := 6976k