From patchwork Thu May 6 16:25:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis K X-Patchwork-Id: 1475160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) 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=desiato.20200630 header.b=qv0F0us9; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=AJ/2tPaF; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (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 4FbfCJ5jqSz9sWk for ; Fri, 7 May 2021 02:28:28 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=cZZpj2ljNrU6ETR31ZOun/lCn6VfeMYB1MsgDb/RpBo=; b=qv0F0us9j4XbYyv+zfJb9/AEZU +LK+zBUIaclqX3d0CcyUVJOnc0tM+a5k/MMsAaQAhn8eZ0yLWQ8/DO0oH7nhQDODoMUohGGK9zdRb K9HdyXDQ4XrpaBYpSzuxfM8QuxCMTHmE/oHIDLqcOqC5CtunzcfRsOGNV1HeZboUBaZg3V56+96gO b/25KRdO4UQTd7mDRv34XsFrfl2yejvBUgcezfC2q//EbtxFrKKQrv+mOmAj55bYNDf2hOrUUC/Zz KnjsxM6I8iqtT6JRCnC4KkGdazCMU21t6az+xmLWo2Gj7qJsfuz7VBTvEEVTjYVamCGgdKzNgPqMD 9wV08rZw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1legpw-004ngt-8S; Thu, 06 May 2021 16:26:52 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1legpr-004nfA-Ma for openwrt-devel@lists.openwrt.org; Thu, 06 May 2021 16:26:49 +0000 Received: by mail-lf1-x132.google.com with SMTP id x19so8662377lfa.2 for ; Thu, 06 May 2021 09:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=74ivE0oQXQKY0xqKmTEeT/KQvlDl9UMWrRcUhPCfcnM=; b=AJ/2tPaFWb48+rU0/ppXwz36XcG5oUv3UTwcVw6qbAOcvuE2z+0n3SyP9TmxGgEniE /ciy25S6s/opWT1GhlEKMKk/p7JTckB3pwPVnt/pPGQS5z6pWj2qbwFk7FGIUWlY/vuz 5Jeq/wYAYu0/U03hb1B+QZOkxhhvpnUGbWft4J5BsoOeGEJDd/1hqQRhK6OP6R2ESn64 w7cuXZ/+SbnKCWRUj/0rtiXMSKG56Jd33SWQxpbjuMI72oVMQAL1U92Ljom5md++xgDU nnBUTBWEuJhjrVqAXibFmugYbNzcsflU+fcGBV7DHdhfJmMhSnNbMeJJf8ZlZlfFfv4S IEkw== 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:mime-version :content-transfer-encoding; bh=74ivE0oQXQKY0xqKmTEeT/KQvlDl9UMWrRcUhPCfcnM=; b=imDZBpSgtNDBfHX1fpUmxiLr/bBGFxyzECO/e269g37yVTxjBMjrzTj91pDSkotCSI btRVC0ATG3B50EcVMpXEaEHkuqfpJzFHT8FaqBbD1xqqtuQpScCcn8taQgn36+lvKzed 5mtmJr4N0pXt4YGCpkhm3cMRe/ofZiaDbcPcaHx58Z5dXLv1VzyVoGP06uxpE8HnstVR V4GLGgOMg/eyIoHlnZwAWLTHHlHsBiZGEryRjDlr/XAYRcEL66gu9T6bsHKCpGhR6ekt Zf5rxdHyTnF1yGDGK5vEBFsX7INRkCBtRQVdKBKK3tqZ+X2RKQ4LuGNuU60+QH50apH7 tWTg== X-Gm-Message-State: AOAM5339NGyI1LY3SNiaDmSjMwnaRTAaN1ZNlvBHrSTMgJcGzJjdLxCR Yw8JyjTGOSqxijfV+SWTt9eGFfA4q8s= X-Google-Smtp-Source: ABdhPJxloRPmSaR1tZfFlY1AfJd1QwUTXJ+iJSQY2RO2sMPjTznrWR4dlULwSiu2OAhiLnIBqYZNuw== X-Received: by 2002:a05:6512:3c95:: with SMTP id h21mr3610581lfv.446.1620318406336; Thu, 06 May 2021 09:26:46 -0700 (PDT) Received: from kalashnikov.user.kdf.lan ([89.18.140.18]) by smtp.gmail.com with ESMTPSA id i1sm787164lfe.53.2021.05.06.09.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 09:26:46 -0700 (PDT) From: Denis Kalashnikov To: openwrt-devel@lists.openwrt.org Cc: Gabor Juhos Subject: [PATCH 0/4] RFC: ath79: add support for Mikrotik RB91xG Date: Thu, 6 May 2021 19:25:10 +0300 Message-Id: <20210506162514.5913-1-denis281089@gmail.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_172647_824699_B27E6C23 X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: 0.1 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: When porting RB91xG ad hoc drivers (gpio-latch and rb91x-nand) from ar71xx to ath79, I made a decision to rework this to more clear design in my opinion: MFD driver that requests and controls the gpio [...] Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:132 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.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [denis281089[at]gmail.com] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [denis281089[at]gmail.com] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 When porting RB91xG ad hoc drivers (gpio-latch and rb91x-nand) from ar71xx to ath79, I made a decision to rework this to more clear design in my opinion: MFD driver that requests and controls the gpio lines, and separate NAND driver and GPIO-latch driver that uses API of the MFD driver (like how in rb4xx-clpd is done). ar71xx gpio-latch is very good, but somewhat hacky, so I don't think that it can be general driver for gpio controller on a latch. I could be wrong. Also it is my first attempt to port OpenWrt to a device, so I need a review from the community. I've tested all these on my RB912UAG-2HPnD. Gigabit Ethernet, 2.4GHz Wi-Fi, sysupgrade and LEDs:) are working for me. Not working: beeper, button and USB port/mPCIe (has not tested yet). Denis Kalashnikov (4): ath79: add MFD driver (NAND and GPIO) for Mikrotik RB91xG ath79: add GPIO-latch driver for Mikrotik RB91xG ath79: add NAND driver for Mikrotik RB91xG ath79: add support of Mikrotik RouterBoard 91xG series .../dts/ar9342_mikrotik_routerboard-912g.dts | 314 +++++++++++++ .../files/drivers/gpio/gpio-latch-rb91x.c | 127 +++++ .../linux/ath79/files/drivers/mfd/rb91x-ngl.c | 331 ++++++++++++++ .../files/drivers/mtd/nand/raw/nand_rb91x.c | 432 ++++++++++++++++++ .../linux/ath79/files/include/mfd/rb91x-ngl.h | 59 +++ target/linux/ath79/image/mikrotik.mk | 9 + .../base-files/etc/board.d/02_network | 2 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + .../base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/mikrotik/config-default | 3 + .../patches-5.4/939-mikrotik-rb91x.patch | 65 +++ 11 files changed, 1344 insertions(+) create mode 100644 target/linux/ath79/dts/ar9342_mikrotik_routerboard-912g.dts create mode 100644 target/linux/ath79/files/drivers/gpio/gpio-latch-rb91x.c create mode 100644 target/linux/ath79/files/drivers/mfd/rb91x-ngl.c create mode 100644 target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb91x.c create mode 100644 target/linux/ath79/files/include/mfd/rb91x-ngl.h create mode 100644 target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch