From patchwork Sat Sep 19 14:39:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1367587 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209 header.b=IwoNGTl7; 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=TR5sa61L; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4BtthL1w3Fz9sTC for ; Sun, 20 Sep 2020 00:42:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=VRoIhcMrO/XLse/klRzIYkKGVMHftq4CU7XZqjMbTfo=; b=IwoNGTl7Bzf1vOp+GtQ8iYlINV iGja7H5zkjyVFFjvtyYIBaJHQBIrESRNjN5JuRQeMsyrzZBEtEMyl1+JY+AuGqGcwoymz4iue4QjD eDqvVPKCTFzPYAVMjausgNiDAnHwIBgmxrGARSE2ZSPtoPO3cjgtDCSlZZFx6QMyz6/c+JpzeqKe0 PDalNosIxO7dYDlvbitAaQLF1AHidtvOD56LxWd8dsPkBcvBsX5uzg1AQf9fY3oEO7+RiBsfLdLVp BiD0B/fZESoUF7JN4ymemh+78f60n2pqAwL3S/CRVgE2c8l3lNPHLTX9yOfCXA8S3ZQyl85Guzzo3 /U/AJibg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2K-0008Lj-P0; Sat, 19 Sep 2020 14:40:24 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2D-0008Hx-CJ for openwrt-devel@lists.openwrt.org; Sat, 19 Sep 2020 14:40:18 +0000 Received: by mail-ej1-x644.google.com with SMTP id gx22so2859660ejb.5 for ; Sat, 19 Sep 2020 07:40:17 -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=kTOoFQ4gQcDuTmAJBBKTjxxKQ+3QGu5OEt13HM9wIE4=; b=TR5sa61L2iVaowNthQmjJpj0YaXzJzVWWGZsftSjgZKFN8sN0axl4E0EIA5gdDqzjs pp0/W0G5+YpUARkGT7/rEOs74UneRzsFETIIUewKPBdS+ApCmma2o8p1Bt5/6FjvhiEX WgiUpVenK/z0SZ56ppKGM0+Tpa7GKpCSYSPd7fxzCey4TT+e/WxkjRgmUbTEtnQc/+06 l7dlVH8cU8m8cyEoH4kitsi7yK+MENgm7RIHQj3guWBKacruZlhJXAz9aGvDlEBBKoCe W8fxv1UrtNS2uZ9yvIDnSc+44veZiNIVga/p20dh04Qh+i6To4sW6erdBQQjh8J3hRmV mJOw== 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=kTOoFQ4gQcDuTmAJBBKTjxxKQ+3QGu5OEt13HM9wIE4=; b=EnjZsNy62ozIHoZf+qmtRcqagZXLuV5wP1xl5PXUXSaEW7XxQrstoVcNxV9NaagR5C jbPt2WdTrca+kx2XeVlirAcVuWsDov+YqpOIEorSiqH08arunmCI6ibS4XxJ/rsePMnW ewumsFa9KzOkpv+jEtFEFJFXicBLyJTtM94LVlotWi52hI3aHXJBGHtCkcNiMliRnV/n WnIFnsuQnE5pIhqfC5ESNroiR1GyJMmz78dWJgOAHRmQB1zQSzGbgR1mYAXlpQKvRW86 FJ1PIEKLHsKRcyuuyfPKZ1CLdqYWpBq1BdQ7l1azGimUAjJ99qra6Fy4Vb8aHP3xnUbP BhMA== X-Gm-Message-State: AOAM530KrJjRIuhED4IkJ9Jcl7nKmhuq0/NUztvzIr0oR5R0MqU8WXr5 dBych37np4rpj6KDTa8wOmWh98sdwhL3og== X-Google-Smtp-Source: ABdhPJw4jGDTKGtWIi5VM+zShlj6d7EPeojRpoZ2B7+orQtt3eeg/ZOjHHBX+tdWqNtT9ULKHNQcDw== X-Received: by 2002:a17:906:faec:: with SMTP id lu44mr40712889ejb.527.1600526416159; Sat, 19 Sep 2020 07:40:16 -0700 (PDT) Received: from debian64.daheim (p4fd09180.dip0.t-ipconnect.de. [79.208.145.128]) by smtp.gmail.com with ESMTPSA id s13sm1993292ejv.7.2020.09.19.07.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 07:40:13 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kJe20-000fSe-Nj; Sat, 19 Sep 2020 16:40:04 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4 1/8] scripts: mkits.sh make it possible to specify fdt@# Date: Sat, 19 Sep 2020 16:39:57 +0200 Message-Id: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_104017_473729_6BF62ED7 X-CRM114-Status: GOOD ( 14.61 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:644 listed in] [list.dnswl.org] 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 [chunkeey[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -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.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafal@milecki.pl, hauke@hauke-m.de, f.fainelli@gmail.com, chrisrblake93@gmail.com, Adrian Schmutzler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Some bootloaders are really keen on just one special fdt in a multi-image fit image. This is a problem, because currently this is fixed to "fdt@1". This patch introduces a new device variable: DEVICE_FDT_NUM that allows to specify the right fdt number. If the value is absent "1" will be chosen. Signed-off-by: Christian Lamparter --- include/image-commands.mk | 1 + include/image.mk | 6 ++++-- scripts/mkits.sh | 12 ++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 9516801c8d..740d627fc7 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -158,6 +158,7 @@ define Build/fit -D $(DEVICE_NAME) -o $@.its -k $@ \ $(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \ -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + $(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \ -A $(LINUX_KARCH) -v $(LINUX_VERSION) PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new diff --git a/include/image.mk b/include/image.mk index 703aeb6816..a1308f47ad 100644 --- a/include/image.mk +++ b/include/image.mk @@ -432,6 +432,7 @@ define Device/Init DEVICE_DTS := DEVICE_DTS_CONFIG := DEVICE_DTS_DIR := + DEVICE_FDT_NUM := SOC := BOARD_NAME := @@ -453,8 +454,9 @@ DEFAULT_DEVICE_VARS := \ DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE KERNEL_SIZE \ CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \ VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \ - DEVICE_DTS_CONFIG DEVICE_DTS_DIR SOC BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \ - IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH IMAGE_SIZE \ + DEVICE_DTS_CONFIG DEVICE_DTS_DIR DEVICE_FDT_NUM SOC BOARD_NAME \ + UIMAGE_NAME SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \ + UBOOT_PATH IMAGE_SIZE \ DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \ DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \ DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \ diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 468ef670e6..bb629d6fca 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -16,7 +16,7 @@ usage() { printf "Usage: %s -A arch -C comp -a addr -e entry" "$(basename "$0")" - printf " -v version -k kernel [-D name -d dtb] -o its_file" + printf " -v version -k kernel [-D name -n address -d dtb] -o its_file" printf "\n\t-A ==> set architecture to 'arch'" printf "\n\t-C ==> set compression type 'comp'" @@ -26,12 +26,15 @@ usage() { printf "\n\t-v ==> set kernel version to 'version'" printf "\n\t-k ==> include kernel image 'kernel'" printf "\n\t-D ==> human friendly Device Tree Blob 'name'" + printf "\n\t-n ==> fdt unit-address 'address'" printf "\n\t-d ==> include Device Tree Blob 'dtb'" printf "\n\t-o ==> create output file 'its_file'\n" exit 1 } -while getopts ":A:a:c:C:D:d:e:k:o:v:" OPTION +FDTNUM=1 + +while getopts ":A:a:c:C:D:d:e:k:n:o:v:" OPTION do case $OPTION in A ) ARCH=$OPTARG;; @@ -42,6 +45,7 @@ do d ) DTB=$OPTARG;; e ) ENTRY_ADDR=$OPTARG;; k ) KERNEL=$OPTARG;; + n ) FDTNUM=$OPTARG;; o ) OUTPUT=$OPTARG;; v ) VERSION=$OPTARG;; * ) echo "Invalid option passed to '$0' (options:$*)" @@ -61,7 +65,7 @@ ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]') # Conditionally create fdt information if [ -n "${DTB}" ]; then FDT_NODE=" - fdt@1 { + fdt@$FDTNUM { description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\"; data = /incbin/(\"${DTB}\"); type = \"flat_dt\"; @@ -75,7 +79,7 @@ if [ -n "${DTB}" ]; then }; }; " - FDT_PROP="fdt = \"fdt@1\";" + FDT_PROP="fdt = \"fdt@$FDTNUM\";" fi # Create a default, fully populated DTS file From patchwork Sat Sep 19 14:39:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1367583 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209 header.b=JqMLYepV; 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=WrHA/yJm; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4Btth95k10z9sRf for ; Sun, 20 Sep 2020 00:42:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=d67UldD4ib/rAvUixb8/X/DmXMQm1mHbUY4HpsDWdL8=; b=JqMLYepVhWTqIdpPYiehKtH1f 36Vh4SVcVMw2NRGkjymN1qVYCiydEGg/NRcGnviPE7RoKutzDSt8yh91zag/Qj05ZV7HmHUd19ov3 Wk1/tCyBylTAepcSpwLWcgxhZJZEErUWlqprfeoEZ8310foL8dg+Hov4+9IHyol8CjCY8WrenCwWo H7czb1759cww5Tk9GmOHlbNHEtvD65jHOW9AOpyfRWn2LCLfavlYux1sNcUn8zltvg7+C0TH+dCZN QMBSAKThp6CPsFU7sIhHvhbjFiVMe88jare/Wsg3pDq3/dJgI9rY1kza/GdLp+nrctLxMeKjPN3Uw JY7rE+/Gw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2M-0008ML-MK; Sat, 19 Sep 2020 14:40:26 +0000 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2E-0008IE-0A for openwrt-devel@lists.openwrt.org; Sat, 19 Sep 2020 14:40:19 +0000 Received: by mail-ej1-x642.google.com with SMTP id j11so11978044ejk.0 for ; Sat, 19 Sep 2020 07:40:17 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=vVK4zUYfaf/JPHjMF7W6zCJC6Tg8/fi7QZCkW+MgU04=; b=WrHA/yJm5n5S1hh8WDzWuBJ+3yOxYHLHlw9zJ/D0qrJSD4qTQLKCrFqhWyMHLn1emV fA0wVh4lF5CST1haon0ScsYPLCoUDhrvq38heDxKlEGsgx73gAOUgG9iG/GNxdPD7gxe 2oskU5jha1SgBBO0c9mRmk3eXrg277GPPzRWxkO4NQJwsiI0KOALSBBczB2JmWilntCu JU1Cco5X85buF/RqTlc7r6ivEaiGZlbVjfEK9p0tLxcvklMn1Qcu4L2vgwvfCvRSXYn/ 9d/5J6fVQYFtrFU/AHGC8dWQJWSbYEkiF7/M1IBxlWxNOCOtgMgpSGlb81aAWJ6TN5NK 1SSw== 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:mime-version:content-transfer-encoding; bh=vVK4zUYfaf/JPHjMF7W6zCJC6Tg8/fi7QZCkW+MgU04=; b=kEsNcQa6eUpy8XshPO33uASvG8/lG5T/iwhmESg6tUfQTDsS8b3IcL8N9Ewc4NlodX OyVZfGt0uAkB6hA/XRIEbfmsvr1rW1diKnkPYqsGo7Ea8mxCX6dG5J9Xkr4D7vb3KFUE OJ8jfcvGiC+FK8POVX1ji5p5tRz48I1dUcuEkeTQImI0fjnW4DrT/IuX2+70a8wfbigE 4nuQuj2QutSWxZQzRAPU/jwU2DPz8gUzDmhsLe3HHW3Vbo3/8ln4Z7IxTHahmZt8efRC /6W+D/NWIIz0BjYfRfvK/XAqWJQBQsfB03v1sjlsbQHtYLqd/WShgly8WT8k1Ob/ZohU N8ig== X-Gm-Message-State: AOAM533+n3VVELCfcJBjCwN7tTyJNK7mWB7xFQRTVSpTq9berfv50iAC 3tcSItksiMdp7gFEN9QlDFesip1xRzeLTg== X-Google-Smtp-Source: ABdhPJwe+/Ebmd0Ms3d+QGbVELwPpslMueVSTzEH5N3QVu505vKSzmS2l63mYYsoPomAPmy7fnHi9w== X-Received: by 2002:a17:906:2619:: with SMTP id h25mr18784489ejc.142.1600526416501; Sat, 19 Sep 2020 07:40:16 -0700 (PDT) Received: from debian64.daheim (p4fd09180.dip0.t-ipconnect.de. [79.208.145.128]) by smtp.gmail.com with ESMTPSA id s22sm4490753eds.21.2020.09.19.07.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 07:40:13 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kJe22-000fSg-PP; Sat, 19 Sep 2020 16:40:06 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4 2/8] build: define PWM_SUPPORT arch feature flag Date: Sat, 19 Sep 2020 16:39:58 +0200 Message-Id: <8d4ccd9d499c7f080e401ee3828bdfb0e5733edf.1600525798.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> References: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_104018_079489_FB154D77 X-CRM114-Status: GOOD ( 15.49 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:642 listed in] [list.dnswl.org] 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 [chunkeey[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -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.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafal@milecki.pl, hauke@hauke-m.de, f.fainelli@gmail.com, chrisrblake93@gmail.com, Adrian Schmutzler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org As the PWM has its own sub-system in the Linux kernel, I think it should be handled in the same way as GPIO, RTC, PCI... This patch introduces a specific feature flag "pwm" and the "leds-pwm" kernel module as the first customer. Signed-off-by: Christian Lamparter --- package/kernel/linux/modules/leds.mk | 16 ++++++++++++++++ scripts/target-metadata.pl | 1 + target/Config.in | 3 +++ 3 files changed, 20 insertions(+) diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index c030b54b39..fe90c6b559 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -159,3 +159,19 @@ define KernelPackage/leds-pca963x/description endef $(eval $(call KernelPackage,leds-pca963x)) + + +define KernelPackage/leds-pwm + SUBMENU:=$(LEDS_MENU) + TITLE:=PWM driven LED Support + KCONFIG:=CONFIG_LEDS_PWM + DEPENDS:= @PWM_SUPPORT + FILES:=$(LINUX_DIR)/drivers/leds/leds-pwm.ko + AUTOLOAD:=$(call AutoLoad,60,leds-pwm,1) +endef + +define KernelPackage/leds-pwm/description + This option enables support for pwm driven LEDs +endef + +$(eval $(call KernelPackage,leds-pwm)) diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index c58f096573..bf6413d315 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -20,6 +20,7 @@ sub target_config_features(@) { /^usb$/ and $ret .= "\tselect USB_SUPPORT\n"; /^usbgadget$/ and $ret .= "\tselect USB_GADGET_SUPPORT\n"; /^pcmcia$/ and $ret .= "\tselect PCMCIA_SUPPORT\n"; + /^pwm$/ and $ret .= "\select PWM_SUPPORT\n"; /^rtc$/ and $ret .= "\tselect RTC_SUPPORT\n"; /^squashfs$/ and $ret .= "\tselect USES_SQUASHFS\n"; /^jffs2$/ and $ret .= "\tselect USES_JFFS2\n"; diff --git a/target/Config.in b/target/Config.in index 9fead5994f..43de4710df 100644 --- a/target/Config.in +++ b/target/Config.in @@ -29,6 +29,9 @@ config PCIE_SUPPORT config PCMCIA_SUPPORT bool +config PWM_SUPPORT + bool + config USB_SUPPORT select AUDIO_SUPPORT bool From patchwork Sat Sep 19 14:39:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1367584 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209 header.b=d6cc9l5b; 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=mSWjLhMK; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4BtthH5v93z9sRf for ; Sun, 20 Sep 2020 00:42:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9RTmeDc7p6PE1dC0cNvBlJYgZodj0mvhh6RE5yHZQ3U=; b=d6cc9l5bu4LYLj8LbzjrWn4v9 j79y7Rb4BFSdwPExjmqvWwQGcacyfI+4bQduJGDVV9UlqZ/B+4ChvbnJCj0uQc4OBD73VrGwYWLS5 eST49S1RfCpeBZHSy3ojnpaS1uEOy44UnX/Ad30q/6qHa5TgW9k6qqv+x+/km9Kv4OtQ38pBOzCzN HQEbavYwN5XvWq1DbBHp1nJPVa/3bmCYVq1i/3bhdnPUOmqSibfMkWuD4YjX95FCBhoMDk/WkIk1l lCIl9YOJo9JJRmfNvSzJM6M7xmmVh48UFpVXHHjWvKjkPKl51LOccjKpPdYVxYNUK6fw6rmH/mU5x TSNpVHuxQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2Q-0008Nv-8G; Sat, 19 Sep 2020 14:40:30 +0000 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2E-0008J4-Uz for openwrt-devel@lists.openwrt.org; Sat, 19 Sep 2020 14:40:21 +0000 Received: by mail-ej1-x641.google.com with SMTP id r7so11856143ejs.11 for ; Sat, 19 Sep 2020 07:40:18 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=DV+IBWbdzFrrWgbMCvhwKQ4wkEV+IGoHjIp0fzi0CHM=; b=mSWjLhMK+F6rdE9e9McnvTPclVixbDgc+CRJhcBroKiK83dyEHe6Xqrn6ewMLu46nV 9YZhKL/3FEVjc9wN5zZVTp+dKR9JN/cV+EwrclQzHTsmpc18BEbtA5BIk997P+STrR8r fEW53dhD82V9oMmQrJNdNlXFBbPg21BepopLTn8cpA7u4ZnS/ua7nK41L2ebeKBJ4HXZ ZaS01f1SX86ayJT7vUNRUp0CvXtM4Cxx74MxrAWxNLDx0/QzxHVVaWKnP9/CZiOyfMmR igcG0JvfNXXnoVlL6yjixPtDWsS/NYIbrA95JRW3idTRTuxzHwrLAYcpB2o+4U8seXzJ lkwA== 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:mime-version:content-transfer-encoding; bh=DV+IBWbdzFrrWgbMCvhwKQ4wkEV+IGoHjIp0fzi0CHM=; b=BoBUMdE6CrCLj05UsVzTCVc4Nf7Msz7hv5hgqZq29o4vC5sfdEJQw8ChR0bx2jnYMJ lQL+Yk73U5XsLQ7NQhzD1DrEKDxTgUemv+RGNB2WPP4ZznmkepzcIQvOZWEr0kz6xbxq 92BAfiFlWQR0JmBnt4Xy5V5VTOCX0D8nfjhOVqOXw/+tBnn6hO1v7wyrWIvn7waN2ZoN +/cAv16y1OwYlJcW9ANwSs6vpeW4RYAZVCEWxBi5Xn+P8nf/EN+80xJVvJyy+COOLh7g ucoyDsqhM2LrkhnweRDQDfZ27PdQuyIgpIjo7y7znY2BXZnPCVTxEu9bI3lEAiGzer3N oQcg== X-Gm-Message-State: AOAM5339juwY+79uoh/tmGi+74fBZl5YGix/xQwUoHRBR/gSUxQYb6Uc K/dmpG+VVazhaGk785DxSw4ytT/hqSJIUw== X-Google-Smtp-Source: ABdhPJwWAtakTFCH8hrJFXP0CBR2Hs1o7iin9YeU5gJuCRD6wDAPa5uuXx1peg+nn9Y7UDbXo+HRZQ== X-Received: by 2002:a17:907:1116:: with SMTP id qu22mr17773098ejb.231.1600526417464; Sat, 19 Sep 2020 07:40:17 -0700 (PDT) Received: from debian64.daheim (p4fd09180.dip0.t-ipconnect.de. [79.208.145.128]) by smtp.gmail.com with ESMTPSA id m19sm4661294ejj.91.2020.09.19.07.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 07:40:14 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kJe24-000fSi-Re; Sat, 19 Sep 2020 16:40:08 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4 3/8] bcm53xx: enable PWM for bcm53xx Date: Sat, 19 Sep 2020 16:39:59 +0200 Message-Id: <3f47a2946d6fb8cd15356f03384cab25da52aec1.1600525798.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <8d4ccd9d499c7f080e401ee3828bdfb0e5733edf.1600525798.git.chunkeey@gmail.com> References: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> <8d4ccd9d499c7f080e401ee3828bdfb0e5733edf.1600525798.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_104019_033587_364ACA01 X-CRM114-Status: GOOD ( 18.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:641 listed in] [list.dnswl.org] 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 [chunkeey[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -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.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafal@milecki.pl, hauke@hauke-m.de, f.fainelli@gmail.com, chrisrblake93@gmail.com, Adrian Schmutzler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The Meraki MR32 (BCM53016A1) uses the pwm to drive the tricolor LED. The driver has been available in upstream for a long time. Only the Device-Tree definition was missing, but it has been queued recently. Signed-off-by: Christian Lamparter --- v2 -> v3 - backport patches from devicetree/next --- target/linux/bcm53xx/Makefile | 2 +- target/linux/bcm53xx/config-5.4 | 3 ++ ...M-dts-BCM5301X-Specify-PWM-in-the-DT.patch | 48 +++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 target/linux/bcm53xx/patches-5.4/033-v5.10-ARM-dts-BCM5301X-Specify-PWM-in-the-DT.patch diff --git a/target/linux/bcm53xx/Makefile b/target/linux/bcm53xx/Makefile index 35f8513801..f980f8a8fb 100644 --- a/target/linux/bcm53xx/Makefile +++ b/target/linux/bcm53xx/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=bcm53xx BOARDNAME:=Broadcom BCM47xx/53xx (ARM) -FEATURES:=squashfs nand usb pci pcie gpio +FEATURES:=squashfs nand usb pci pcie gpio pwm CPU_TYPE:=cortex-a9 SUBTARGETS:=generic diff --git a/target/linux/bcm53xx/config-5.4 b/target/linux/bcm53xx/config-5.4 index eacfcb620e..8c7cdf45d5 100644 --- a/target/linux/bcm53xx/config-5.4 +++ b/target/linux/bcm53xx/config-5.4 @@ -308,6 +308,9 @@ CONFIG_PINCTRL=y # CONFIG_PINCTRL_IPROC_GPIO is not set CONFIG_PINCTRL_NS=y # CONFIG_PINCTRL_NS2_MUX is not set +CONFIG_PWM=y +CONFIG_PWM_BCM_IPROC=y +CONFIG_PWM_SYSFS=y CONFIG_RATIONAL=y CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y diff --git a/target/linux/bcm53xx/patches-5.4/033-v5.10-ARM-dts-BCM5301X-Specify-PWM-in-the-DT.patch b/target/linux/bcm53xx/patches-5.4/033-v5.10-ARM-dts-BCM5301X-Specify-PWM-in-the-DT.patch new file mode 100644 index 0000000000..335378656c --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/033-v5.10-ARM-dts-BCM5301X-Specify-PWM-in-the-DT.patch @@ -0,0 +1,48 @@ +From 0ea4b29d149586667d96767f1fc8e57ee942c1b0 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 22 Aug 2020 18:19:19 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Specify PWM in the DT + +The BCM53016 in the Meraki MR32 uses the on-chip PWM +controller to drive a tri-color RGB LED. Since I plan +to use the PWM, I made a label for the pwm's pinmux +node. This way, it can be easily referenced.... And +Also included a label for the i2c since I'm going to +need it in the future too. + +Signed-off-by: Christian Lamparter +Acked-by: Scott Branden +Signed-off-by: Florian Fainelli + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -350,6 +350,14 @@ + }; + }; + ++ pwm: pwm@18002000 { ++ compatible = "brcm,iproc-pwm"; ++ reg = <0x18002000 0x28>; ++ clocks = <&osc>; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ + mdio: mdio@18003000 { + compatible = "brcm,iproc-mdio"; + reg = <0x18003000 0x8>; +@@ -417,12 +425,12 @@ + function = "spi"; + }; + +- i2c { ++ pinmux_i2c: i2c { + groups = "i2c_grp"; + function = "i2c"; + }; + +- pwm { ++ pinmux_pwm: pwm { + groups = "pwm0_grp", "pwm1_grp", + "pwm2_grp", "pwm3_grp"; + function = "pwm"; From patchwork Sat Sep 19 14:40:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1367585 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209 header.b=Kk6K/nBn; 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=kS2UtWxY; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4BtthK65mtz9sT6 for ; Sun, 20 Sep 2020 00:42:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DDUY9KhfD85xXz12whfGlL33KilhoK2Nu6r/tBu/Qxs=; b=Kk6K/nBnlTnRrCreLWAR+ZPTk to9iqsbbeG4RWJFcWcCRe3nh/5xb2Q8AdOU7Wj2pgWviURrWwLF5bwcjX/tdJQTj3J5dtEQtGIiNl xwz1+n2cfhuAVkBpKew+lGATPpwve8JvlUfE8aHHii9xRKyliqiCWeS7vu0tdpx9Is+ZcH9Z+PV6/ 3f79zi63k/QhqUCvzENERr/fiEhQ+1fs3FGLHmx43McmqSaNnCGeIsqMETCmvdZR7rIPnlCks6VjX lKRXSbSEhCFpcwDInKueg9tA2XHeUsdH+231NxDN9e9jSFLR9OGTrVYKfWjke4F403N+4WV5xwS32 0dntF/XsA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2O-0008NJ-P3; Sat, 19 Sep 2020 14:40:28 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2E-0008IX-DC for openwrt-devel@lists.openwrt.org; Sat, 19 Sep 2020 14:40:21 +0000 Received: by mail-ej1-x62d.google.com with SMTP id nw23so11879714ejb.4 for ; Sat, 19 Sep 2020 07:40:18 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=c2U/j1WsNAwzhJ5TqxzI051dgxnqs4qmGx3kJq+HBco=; b=kS2UtWxY9a+w8XecTQCMLUAwS0t6JKcKTqi9FxhedfebDRF6+CYy5E0/Pj/rH1+vCg eQqabjHuGvp+z+jOBsteSbXtWNDLtcCX5HWL5yQdcTmTYaAGcILlR3va6BA02pAdxo6b PRpVw8eVURLzVwuWPvsh31htH0pULWMYs2oANgxPklwmbll0Tjpz1G9xbGlzUNzcomN7 mGTYSJkshnfqHkkpw+ndqxQF0tG4HeM7miyeo7zV1yPLvWeCTtabqoHMPcuYaJieT+RW Sd3qBmeiPqYJVB1jYIVQF7JB+Yq3OXJuKCCgUXgcRBA0O1fah1nkX+7IB5XdtWwSJgZ+ Fdvg== 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:mime-version:content-transfer-encoding; bh=c2U/j1WsNAwzhJ5TqxzI051dgxnqs4qmGx3kJq+HBco=; b=FJfoVScefKj2l3Kd2RIwt/vU3Iw+1k9qSYs9/QSwRZnUKA935/Wj8AGR/EI6V4IvnJ f6Nkn/rz/WwARPe3oOPA4Xa0tmWRdMq/IzxZJYEJ+OPRvSJinCuV8/htTymFfaoRi1Vq jAkaTkhu71qbpCPcqeZlqYgFXCMfwMek9McYpB5NhfVF+CMFhqf6i3YofsWVPaWS4QmW qLJWIts5e9mYaZjXA0NRIhHUrdFTMvNRNDyfGkTchDovDc3cAoY3xglnDZhjeZ8sGulb n66nqJlgUcQMp4FENiD0K/DoiEIQwXpdMojj35LJ+idp6uyFET2OIpW1JuxexVmFDkwm tOJw== X-Gm-Message-State: AOAM5320lXlRWG6/lH+ieeGqdAOLdorNWLqyLISiGaf5dU7rup3rZyrB jLRMWoxTPuT3tbfKn19Zrj70qNHXoVRmQA== X-Google-Smtp-Source: ABdhPJwlp2ASt7XzFQIksNWOxLi2wPBhC3+c74U7fuGO6NZd8b8pW8ydum0y0Kvxb7WWTEil4bAYkg== X-Received: by 2002:a17:906:d787:: with SMTP id pj7mr39476821ejb.340.1600526416788; Sat, 19 Sep 2020 07:40:16 -0700 (PDT) Received: from debian64.daheim (p4fd09180.dip0.t-ipconnect.de. [79.208.145.128]) by smtp.gmail.com with ESMTPSA id q16sm4442661ejo.49.2020.09.19.07.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 07:40:14 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kJe27-000fSk-UI; Sat, 19 Sep 2020 16:40:11 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4 4/8] bcm53xx: backport uart2 and pcie2 device-nodes Date: Sat, 19 Sep 2020 16:40:00 +0200 Message-Id: <6738ae97125b563bc7f6655f9cf69f5ff1ac6e98.1600525798.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <3f47a2946d6fb8cd15356f03384cab25da52aec1.1600525798.git.chunkeey@gmail.com> References: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> <8d4ccd9d499c7f080e401ee3828bdfb0e5733edf.1600525798.git.chunkeey@gmail.com> <3f47a2946d6fb8cd15356f03384cab25da52aec1.1600525798.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_104018_468426_B9F56791 X-CRM114-Status: GOOD ( 18.37 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:62d listed in] [list.dnswl.org] 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 [chunkeey[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -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.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafal@milecki.pl, hauke@hauke-m.de, f.fainelli@gmail.com, chrisrblake93@gmail.com, Adrian Schmutzler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org These have made their way into -next. This patch also includes the portion of the bcm53xx kernel patch refreshes as the hunks in 302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch moved slightly due to the added nodes. Signed-off-by: Christian Lamparter --- v2 -> v3 - backport patches from devicetree/next - make target/linux/refresh --- ...dts-BCM5301X-Specify-uart2-in-the-DT.patch | 30 +++++++++++++++++++ ...dts-BCM5301X-Specify-pcie2-in-the-DT.patch | 26 ++++++++++++++++ ...01X-Update-Northstar-pinctrl-binding.patch | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 target/linux/bcm53xx/patches-5.4/034-v5.10-ARM-dts-BCM5301X-Specify-uart2-in-the-DT.patch create mode 100644 target/linux/bcm53xx/patches-5.4/035-v5.10-ARM-dts-BCM5301X-Specify-pcie2-in-the-DT.patch diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.10-ARM-dts-BCM5301X-Specify-uart2-in-the-DT.patch b/target/linux/bcm53xx/patches-5.4/034-v5.10-ARM-dts-BCM5301X-Specify-uart2-in-the-DT.patch new file mode 100644 index 0000000000..8cee6745ee --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.10-ARM-dts-BCM5301X-Specify-uart2-in-the-DT.patch @@ -0,0 +1,30 @@ +From 5e396bb05b89e23e98e6d75749b77502e68210a4 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 22 Aug 2020 18:19:20 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Specify uart2 in the DT + +The BCM53016 in the Meraki MR32 utilizes the third "uart2" +to connect to a on-board Bluetooth-LE 4.0 BCM20732 chip. + +Signed-off-by: Christian Lamparter +Reviewed-by: Scott Branden +Signed-off-by: Florian Fainelli + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -392,6 +392,15 @@ + reg = <0x18105000 0x1000>; + }; + ++ uart2: serial@18008000 { ++ compatible = "ns16550a"; ++ reg = <0x18008000 0x20>; ++ clocks = <&iprocslow>; ++ interrupts = ; ++ reg-shift = <2>; ++ status = "disabled"; ++ }; ++ + i2c0: i2c@18009000 { + compatible = "brcm,iproc-i2c"; + reg = <0x18009000 0x50>; diff --git a/target/linux/bcm53xx/patches-5.4/035-v5.10-ARM-dts-BCM5301X-Specify-pcie2-in-the-DT.patch b/target/linux/bcm53xx/patches-5.4/035-v5.10-ARM-dts-BCM5301X-Specify-pcie2-in-the-DT.patch new file mode 100644 index 0000000000..d3e2fbcc9e --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/035-v5.10-ARM-dts-BCM5301X-Specify-pcie2-in-the-DT.patch @@ -0,0 +1,26 @@ +From c4cd6fcae46fd14aed8665b7cf66d0954765a873 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 22 Aug 2020 18:19:21 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Specify pcie2 in the DT + +The SoC supports three pcie ports. Currently, only +pcie0 and pcie1 are enabled. This patch adds the +pcie2 port as well. + +Signed-off-by: Christian Lamparter +Reviewed-by: Scott Branden +Signed-off-by: Florian Fainelli + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -252,6 +252,10 @@ + reg = <0x00013000 0x1000>; + }; + ++ pcie2: pcie@14000 { ++ reg = <0x00014000 0x1000>; ++ }; ++ + usb2: usb2@21000 { + reg = <0x00021000 0x1000>; + diff --git a/target/linux/bcm53xx/patches-5.4/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch b/target/linux/bcm53xx/patches-5.4/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch index 77bc68c8ce..1d71647d60 100644 --- a/target/linux/bcm53xx/patches-5.4/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch +++ b/target/linux/bcm53xx/patches-5.4/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch @@ -9,7 +9,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -401,16 +401,12 @@ +@@ -422,16 +422,12 @@ #size-cells = <1>; cru@100 { From patchwork Sat Sep 19 14:40:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1367581 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209 header.b=tzoGr/VP; 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=ENGes9tE; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4Btth668Wgz9sRf for ; Sun, 20 Sep 2020 00:41:58 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vEP+c+qVtFiC44kT/vYjUz5O+P8VAY+9S029QfjHmto=; b=tzoGr/VPc76Bir23fnP0j8YIc DBeUTBmfUWZ9rkbdgOKaFTZcKxoVCsohTOxwCWsjmcNyoff1+xW2KozAcRp29SOTShOHMk+kDENqw ZVbnheJqHJEw+jXM0zIJHwYguGgvG96IXd1AorfTCTiElbgixpPLu7Ub6kXKUhE/nau/bF+UXAVb1 DB4ijzF3Mcm03nItA+G8ehjbTmw+6Stue3LNCT10XY0V+mGcvIV0BjmH3RmgRzhohUrJr/V7Ozx/t L+3lEZeVLIsPMOKcoUMU1x0eNjolRL3trjg8dgGHl6r1jV+XpMVsr2nh0MNQc+uEY/WcA+8P6n0l9 kw5crOIWg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2E-0008JE-Nz; Sat, 19 Sep 2020 14:40:18 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2B-0008Gt-QQ for openwrt-devel@lists.openwrt.org; Sat, 19 Sep 2020 14:40:16 +0000 Received: by mail-ed1-x544.google.com with SMTP id w1so8796526edr.3 for ; Sat, 19 Sep 2020 07:40:15 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=A7PuxjpXr4dcVQ7i/G595MNPMek1yBkElIjm1ws6fk0=; b=ENGes9tEEu8KPEU4vg9RKY1+Gt1jTuqDy+ihKaDlQkPTZ3OCnHF8c+BBp1Ik/qDwGA cGj4QrMlkUjtHwqsw0TYEjvsefR8+3iSXtJ/vAQAONZOf5i0DDL743aJNsum7Hhi7LA8 9hrQr8QspYP7KzLbBsygTkScY5ZodPyRgta/IQCIhMiwg90uNvRn12vUIV0A5o3yJPYh Pi1JATa/NXK5u1mBdhpWjdiYCAU/wT3cH7cGmhYSEwuk0JNd8uiTeTRQ4gcnAq+TvvTC EKgx9iG5UvAOj0rQTol6965j7jqjBd8PZxSa2RJhsXBkJb8Lwobb4RrkjaS2n+gMwMKZ /L+w== 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:mime-version:content-transfer-encoding; bh=A7PuxjpXr4dcVQ7i/G595MNPMek1yBkElIjm1ws6fk0=; b=BRHo4FS3JgoBnN48LudDYig5wKQ2xVJ585l+1Ih4zUEzqFSt/hV9hPR3lQbQNiYQnD QNVE4LmnPxDtybqgnzRAlMDMerC+A2uERflQKfFrQ4hqjkaX4lcZLcXDTmn2qHyNIAPp i0hOdUrjUrfbMyoLjq6UbZmVjdOg/UwWWAaRZ+GrdSUOYGXWwA4Hp90FhU5TwZHhZ65B dsqL3t8HY1As6fR0uvYiwu2dkiGGUSXH1kDzVojljIuWyHWI0oLEY2mYEGpBRwLlLzZY zAYNOuB/Sr4EutRlvJTvg9dhKND3WErpx5yH2jKjQivxmCyLxOHYE26UOXGB4rmvZo3g 1gXA== X-Gm-Message-State: AOAM530P1EQN57YuD4wPknSeEQA4TbXZvOn1zB/csVjPNiOOvUovZ4yT x7J2UiGITpQaXGRpVpkyi/qh2LHUELwMrw== X-Google-Smtp-Source: ABdhPJxAkcvgGpGk0B3WAqZJSNL8lpljphlCQdB0qaSB3zb5xi3YKWqyjjQgZDvH0qazlUGN0pFoBQ== X-Received: by 2002:a50:fb15:: with SMTP id d21mr45577164edq.150.1600526414301; Sat, 19 Sep 2020 07:40:14 -0700 (PDT) Received: from debian64.daheim (p4fd09180.dip0.t-ipconnect.de. [79.208.145.128]) by smtp.gmail.com with ESMTPSA id x25sm4437184edv.42.2020.09.19.07.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 07:40:13 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kJe29-000fSu-1T; Sat, 19 Sep 2020 16:40:13 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4 5/8] kernel: add default for new config symbols Date: Sat, 19 Sep 2020 16:40:01 +0200 Message-Id: X-Mailer: git-send-email 2.28.0 In-Reply-To: <6738ae97125b563bc7f6655f9cf69f5ff1ac6e98.1600525798.git.chunkeey@gmail.com> References: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> <8d4ccd9d499c7f080e401ee3828bdfb0e5733edf.1600525798.git.chunkeey@gmail.com> <3f47a2946d6fb8cd15356f03384cab25da52aec1.1600525798.git.chunkeey@gmail.com> <6738ae97125b563bc7f6655f9cf69f5ff1ac6e98.1600525798.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_104016_061615_DD786711 X-CRM114-Status: GOOD ( 12.79 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:544 listed in] [list.dnswl.org] 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 [chunkeey[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -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.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafal@milecki.pl, hauke@hauke-m.de, f.fainelli@gmail.com, chrisrblake93@gmail.com, Adrian Schmutzler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Provide disabled defaults for I2C_SLAVE_EEPROM and IPMB_DEVICE_INTERFACE. Signed-off-by: Christian Lamparter --- target/linux/generic/config-5.4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 6f63b8c5dd..1c28addff4 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -2134,6 +2134,7 @@ CONFIG_HW_RANDOM_TPM=y # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_SLAVE is not set +# CONFIG_I2C_SLAVE_EEPROM is not set # CONFIG_I2C_SMBUS is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_TAOS_EVM is not set @@ -2394,6 +2395,7 @@ CONFIG_IO_STRICT_DEVMEM=y # CONFIG_IP6_NF_TARGET_SYNPROXY is not set # CONFIG_IPACK_BUS is not set # CONFIG_IPC_NS is not set +# CONFIG_IPMB_DEVICE_INTERFACE is not set # CONFIG_IPMI_HANDLER is not set # CONFIG_IPV6 is not set # CONFIG_IPV6_FOU is not set From patchwork Sat Sep 19 14:40:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1367582 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209 header.b=u3PNkCDo; 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=ZRzlpByn; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4Btth842m1z9sT6 for ; Sun, 20 Sep 2020 00:42:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7s768ShosFt/wnkbXkmyuRQDlQ1jDp5lhUvM/DmEI6I=; b=u3PNkCDodPcwQj8kiq3GWU5hM pohCXyEbw/a5IX8UDD9AQBBDPBfqaUiFfKP+PXw3PgA7FGC7tJPCk2v09+YLPdv/qHGXBenNq6ehs SnnD0/2Pmc+OA88Pv4tX3HQjg9PQ0ETQQqt9CyFzmwVg2N+bjgXQykeX4ncHAD0q0wcgBRbcWHY1H h37L6OgykV5dl9Z3sxeshfm6JwtSJSfEj5v8z40onRfr8l/LPeGtcgL25SpBq9FUFg1z7CVqbO6S/ h6ViJbRqb2QEuVT4UgVFPTusKBnEksBl6CXVYKgvNURdSzJSX6XScwyt70RelfZyXNsOg2ACT2/yF K7prF4SVw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2H-0008KT-Bs; Sat, 19 Sep 2020 14:40:21 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2C-0008Gy-86 for openwrt-devel@lists.openwrt.org; Sat, 19 Sep 2020 14:40:17 +0000 Received: by mail-ej1-x644.google.com with SMTP id nw23so11879617ejb.4 for ; Sat, 19 Sep 2020 07:40:15 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=xxRcRtIKyOy8/MdnjfPGMzGiRqv57A7wMBM2Fl43Utg=; b=ZRzlpByn6rtJr3osN35MlMMAMwpXrzhVVECmexkGiOf7KUxW0Xi4HnUeHn9VQ3B/1V XPTKoZJI8jqxDqK8DU32B5CVO4nl4PYthNHJRF9MRTI+TyvHgOgQirWwFykN5V5SZD22 QZg+y4mFaTXNzAoQ6nY6IQrnkrJxVGFL8FJ6xH9gBwmT+McUQ4WcakvAnyHxYjyZA9uz cDccjdYmM56L1dQjUFYJ+VSsnck+aPJB3rfANIxB9+VvNWqulRUQSQbx+pRgAk6kgVlX YcMfMOCm7ed09QWzQvowfKqEeOI0YYWjMZqF0SJzZcdkz/rDy1VWEsqkahUmXchQ4Jus NnfQ== 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:mime-version:content-transfer-encoding; bh=xxRcRtIKyOy8/MdnjfPGMzGiRqv57A7wMBM2Fl43Utg=; b=LSS/4fmfJbLzu/r+jymfFoBB0I6WR/BGcHdmH4xrt9UVcIgnR83KPZssHmSlPTBXvT tFmeZmOQ1TgVJ4QqYTlDZSo7TXN3bBVz1l3jkjW1HsgBI77ilv1G8oxuA40FvZlpUqcw gE6rTDznZdFp98u8CrP33tLO5kBV2ovEhP4U63TMsrhdhXS5EeLOggrGyRck1GJ0Md8K zj0R5zbMQc5QYXVv+T+DDM0Y8EwzzY9d8o88dmpDigaESpRhwEJ6nz3GXRFvnmU2tZSR tOMXsQSvkJr8tsrkfLIkEJNcV6j8/p0yxsGawdFfAcgnWAA4SSUCe1QDzXAdctQykYTo Bekw== X-Gm-Message-State: AOAM531wJjInz+1TXOV4XHrjVhyR0oM25jCidU7SlyDWEMCKKok0JFtB 6TxrHwZiZ+cSS9kKFh5kvA+cQ5nvcAAKVA== X-Google-Smtp-Source: ABdhPJzQpCK8WPkhXbS0+tUtTg/5W/CZpjNq/E+J4eM8i8BfgzpUIRzX6U15MjA99B1hvoUYN1zLZw== X-Received: by 2002:a17:907:4276:: with SMTP id nq6mr36005529ejb.246.1600526414661; Sat, 19 Sep 2020 07:40:14 -0700 (PDT) Received: from debian64.daheim (p4fd09180.dip0.t-ipconnect.de. [79.208.145.128]) by smtp.gmail.com with ESMTPSA id qu11sm4575056ejb.15.2020.09.19.07.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 07:40:13 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kJe29-000fSw-2y; Sat, 19 Sep 2020 16:40:13 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4 6/8] kernel: package bcm53xx i2c module Date: Sat, 19 Sep 2020 16:40:02 +0200 Message-Id: X-Mailer: git-send-email 2.28.0 In-Reply-To: References: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> <8d4ccd9d499c7f080e401ee3828bdfb0e5733edf.1600525798.git.chunkeey@gmail.com> <3f47a2946d6fb8cd15356f03384cab25da52aec1.1600525798.git.chunkeey@gmail.com> <6738ae97125b563bc7f6655f9cf69f5ff1ac6e98.1600525798.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_104016_332251_36D649BD X-CRM114-Status: GOOD ( 11.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:644 listed in] [list.dnswl.org] 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 [chunkeey[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -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.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafal@milecki.pl, hauke@hauke-m.de, f.fainelli@gmail.com, chrisrblake93@gmail.com, Adrian Schmutzler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The BCM5301x SoCs do have i2c. Since this is only being used by the Meraki MR32, this will be packaged as a module. Signed-off-by: Christian Lamparter --- v3 -> v4 - moved to target/linux/bcm53xx/modules.mk --- target/linux/bcm53xx/modules.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/linux/bcm53xx/modules.mk b/target/linux/bcm53xx/modules.mk index b3bb42578c..ab3bab3f15 100644 --- a/target/linux/bcm53xx/modules.mk +++ b/target/linux/bcm53xx/modules.mk @@ -35,3 +35,18 @@ define KernelPackage/phy-bcm-ns-usb3/description endef $(eval $(call KernelPackage,phy-bcm-ns-usb3)) + +define KernelPackage/i2c-bcm-iproc + TITLE:=Broadcom iProc I2C controller + KCONFIG:=CONFIG_I2C_BCM_IPROC + DEPENDS:=@TARGET_bcm53xx +kmod-i2c-core + SUBMENU:=(I2C_MENU) + FILES:=$(LINUX_DIR)/drivers/i2c/busses/i2c-bcm-iproc.ko + AUTOLOAD:=$(call AutoLoad,59,i2c-bcm-iproc,1) +endef + +define KernelPackage/i2c-bcm-iproc/description + Kernel module for the Broadcom iProc I2C controller. +endef + +$(eval $(call KernelPackage,i2c-bcm-iproc)) From patchwork Sat Sep 19 14:40:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1367588 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209 header.b=Eu91EPu5; 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=hMiikjRt; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4BtthP4p3kz9sRf for ; Sun, 20 Sep 2020 00:42:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CnzgKHUXeUQaJgekDnBajYWFXZpxCnRN7oqHdgFL0/E=; b=Eu91EPu58XpEQUnWKac6XQGqh 8gNClV1NQilGr4J3Ps/ujBVcBiKNT/pUL77ourbYJK5zTVTY+LG0/MeoPXDsbAxwaIL9ymZLTWbbT LYd5L+PpQfOx4/wVQJsF+xO0gLQ88Lsy/RB43vco7Tnqe7Is3Q95LDyL2OOJGte1X0daessAc+UUf gVEYsI9pkrmiOytwWJFFnGQEqe59mtIEsBdBWI5b3F8okCjKPGsjYBCkUXWIO5YtVJOB+DU2coHaw SVwzYZITJ4o+sAmM2yuz15nhRwNpjoIaxCcvdPjo48MAGmqj6sBvSPjfy2R80VO4Bvd/g+BebaMzG +IF3Dwchw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2R-0008OQ-N6; Sat, 19 Sep 2020 14:40:31 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2D-0008I1-FJ for openwrt-devel@lists.openwrt.org; Sat, 19 Sep 2020 14:40:22 +0000 Received: by mail-ed1-x544.google.com with SMTP id w1so8796582edr.3 for ; Sat, 19 Sep 2020 07:40:17 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=G1CaKd3MH94A8NuvIhKu9LxNsJGFv1tvimB4eK4oj9g=; b=hMiikjRtAPncVrarJJ18x3OV7zpbAY0XCKnVMsgdPU198to+xWGlHnvrRZI5Ork1He NnC0tVeA8JUX7LByCF7ItdtHmo0VAsLSYkq1jBmZgHXVqwNvcE2wyuCHSueboXLKVT0b bkedxVVkZ9wj1xNlx7E/IsrwsWv8+NbD3w5zy/i6ixOLyCWr8OfvjX0kYbQ1Xe8mhPUB KQQMPYw1EoArG6M9pwwTvO/HT+FvwRC6vxCilWV5ixgm4mR/Dft9Qq8TNpGtxFoyf23/ JdDF5y73KDvoy7KZy7n62GyLG6uqG+x/HnwRif9RomxrF8HEVOGtbZrRojkZJpIx9aPd vKkQ== 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:mime-version:content-transfer-encoding; bh=G1CaKd3MH94A8NuvIhKu9LxNsJGFv1tvimB4eK4oj9g=; b=sGv5VYLa/W8qZj86u4PXpKluYjU/g9BzxZaGOpLDp5iXhmfjrP1uhogEZpyvRvkEtl UwUEhqOeKEl82bHOZO2kKZ27+CNa3vvYAPnUvv+mdzB3zIp8S4R7syNISdq6z5zEMrpG C0yv/aEIobMIx9P4ZdIH58ku3NFxBCZZzYz9t4hADMtdZsT3zzSOyynCocXBG/Pgr1ZN Qf16690qQSY0h1Rkl6KLlh431A2TyT+5pFOwR0JjzBdx+inToFmWWW1BYZgwI87Wx/5v PjZHeW3uq4CT8qOCi3kSSxroCL+AYIoU1bl7Uotv68Tta1HDV/wO+gehtEI4FyFoRCBg Iprg== X-Gm-Message-State: AOAM530QJN6lywg1FjMqAWK2IFG0Umq14q6ZuS2afrbOb2s2CSBG2wx+ s1/xspza6NoxdrHq9b9/Yjh8lvlodAwoJA== X-Google-Smtp-Source: ABdhPJyS2mHRnu5Tn8KZ2MZ+3NgMTdK29h5d2DW5IkeCsxVU37dI4legfKzV62gtFff6Ua9kq3/WbA== X-Received: by 2002:a50:fb98:: with SMTP id e24mr43365323edq.130.1600526415664; Sat, 19 Sep 2020 07:40:15 -0700 (PDT) Received: from debian64.daheim (p4fd09180.dip0.t-ipconnect.de. [79.208.145.128]) by smtp.gmail.com with ESMTPSA id q17sm4571659ejd.90.2020.09.19.07.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 07:40:13 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kJe29-000fT1-4M; Sat, 19 Sep 2020 16:40:13 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4 7/8] bcm53xx: add Cisco Meraki MR32 Date: Sat, 19 Sep 2020 16:40:03 +0200 Message-Id: <2a6d5b3755d1ba02cad0d8df46afdc0fcbb05b8e.1600525798.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> <8d4ccd9d499c7f080e401ee3828bdfb0e5733edf.1600525798.git.chunkeey@gmail.com> <3f47a2946d6fb8cd15356f03384cab25da52aec1.1600525798.git.chunkeey@gmail.com> <6738ae97125b563bc7f6655f9cf69f5ff1ac6e98.1600525798.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_104017_645432_A258CA32 X-CRM114-Status: GOOD ( 36.85 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:544 listed in] [list.dnswl.org] 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 [chunkeey[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 NUMERIC_HTTP_ADDR URI: Uses a numeric IP address in URL -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.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafal@milecki.pl, hauke@hauke-m.de, f.fainelli@gmail.com, chrisrblake93@gmail.com, Adrian Schmutzler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch adds support for Cisco Meraki MR32. The unit was donated by Chris Blake. Thank you! WARNING: Only the 1x1:1 abgn Air Marshal WIPS wifi is currently supported by b43: b43-phy2: Found PHY: Analog 9, Type 4 (N), Revision 16 b43-phy2: Found Radio: Manuf 0x17F, ID 0x2057, Revision 9, Version 1 b43-phy2: Loading firmware version 784.2 (2012-08-15 21:35:19) and only as 802.11ABG! while WIFI1 and WIFI2 (both BCM4352) are not: b43-phy0: Broadcom 4352 WLAN found (core revision 42) b43-phy0 ERROR: FOUND UNSUPPORTED PHY (Analog 12, Type 11 (AC), Revision 1) Hardware Highlights: SoC: Broadcom BCM53016A1 (1 GHz, 2 cores) RAM: 128 MiB NAND: 128 MiB Spansion S34ML01G2 (~114 MiB useable) ETH: 1GBit Ethernet Port - PoE WIFI1: Broadcom BCM43520 an+ac (2x2:2 - id: 0x4352) WIFI2: Broadcom BCM43520 bgn (2x2:2 - id: 0x4352) WIFI3: Broadcom BCM43428 abgn (1x1:1 - id: 43428) BLE: Broadcom BCM20732 (ttyS1) LEDS: 1 x Programmable RGB Status LED (driven by a PWM) 1 x White LED (GPIO) 1 x Orange LED Fault Indicator (GPIO) 2 x LAN Activity / Speed LEDs (On the RJ45 Port) BUTTON: one Reset button MISC: AT24C64 8KiB EEPROM (i2c - stores Ethernet MAC + Serial#!) ina219 hardware monitor (i2c) Kensington Lock SERIAL: WARNING: The serial port needs a TTL/RS-232 3V3 level converter! The Serial setting is 115200-8-N-1. The board has a populated right angle 1x4 0.1" pinheader. The pinout is: VCC, RX, TX, GND. (Use a multimeter) Flashing needs a serial adaptor (due to the lack of a working dropbear on the original firmware). This flashing procedure for the MR32 was tested with firmware: "r23-149867:150252-aacharya". 0. Create a seperate Ethernet LAN which does not have access to the internet. Ideally use 192.168.1.2 for your PC. Make sure to reserve 192.168.1.1 it will be used later on by the OpenWrt firmware. The original Meraki firmware will likely try to setup the network via DHCP Discovery, so make sure your PC is running a DHCP-Server (i.e.: dnsmasq) '# dnsmasq -i eth# -F 192.168.1.5,192.168.1.50 Furthermore, the PC needs a supported ssh/http/ftp server in order to retrieve the initramfs + dtb file 1. Disassemble the MR32 device by removing all screws (4 screws are located under the 4 rubber feets!) and prying open the plastic covers without breaking the plastic retention clips. Once inside, remove all the screws on the outer metal shielding to get to the PCB. It's not necessary to remove the antennas! 2. Connect the serial cable to the serial header. 3. Partially reassemble the outer metal shielding to ensure that the SoC has a proper heat sink. 4. Connect the Ethernet patch cable to the device and the power cable. 5. Wait for the device to boot and enter the root shell. (rooting is not discussed in detail here please refer to Chris Blake - "pwning the meraki mr18" blog post: (The same method works with the MR32's r23-149867:150252-aacharya) Wait for the MR32 to enter the "" prompt and enter: odm serial_num read (Verify that it matches what's on the S/N Sticker on the back!) odm serial_num write Q2XX-XXXX-XXXV odm serial_num read (Verify that the S/N has changed - and the LED start to flash) now to flash the firmware: odm firmware part.safe "http://192.168.1.2/mr32-initramfs.bin" Once OpenWrt booted use sysupgrade to permanently install OpenWrt. To do this: Download the latest sysupgrade.bin file for the MR32 to the device and use sysupgrade *sysupgrade.bin to install it. WARNING: DO NOT DELETE the "storage" ubi volume! To flash later MR32 Firmwares like r25-201804051805-G885d6d78-dhow-rel requires in-circut-i2c tools to access the I2C EEPROM AT24C64 next to the SoC. The idea is pretty much the same as from Step 5 from above: Change the serial number to Q2XXXXXXXXXV (should be around 0x7c), then attach a serial cable, ethernet (but make sure the device can't reach the internet!) hit "s" (the small s!) during boot to enter the root-shell and add the following commands to the /storage/config there: serial_allow_odm true serial_access_enabled true serial_access_check false valid_config true and then hit exit to let it finish booting. Signed-off-by: Christian Lamparter --- rfc -> v2 - fixed Adrian's comments - unbroke sysupgrade on other bcm53xx v2 -> v3 - use florians patch - make a separate patch for the i2c-gpio -> i2c-hw v3 -> v4 - remove superflous kmod-hwmon-core --- .../bcm53xx/base-files/etc/board.d/02_network | 7 +- target/linux/bcm53xx/base-files/etc/diag.sh | 3 + .../lib/preinit/07_set_preinit_iface_bcm53xx | 14 + .../base-files/lib/upgrade/platform.sh | 43 ++- target/linux/bcm53xx/image/Makefile | 27 ++ ...-ARM-BCM5301X-Add-DT-for-Meraki-MR32.patch | 261 ++++++++++++++++++ .../331-Meraki-MR32-Status-LEDs.patch | 28 ++ 7 files changed, 380 insertions(+), 3 deletions(-) create mode 100644 target/linux/bcm53xx/base-files/lib/preinit/07_set_preinit_iface_bcm53xx create mode 100644 target/linux/bcm53xx/patches-5.4/330-ARM-BCM5301X-Add-DT-for-Meraki-MR32.patch create mode 100644 target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index 5752b7760d..231566cfa0 100755 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -89,10 +89,15 @@ bcm53xx_setup_macs() netgear,r8500) # As vendor doesn't use eth0 its MAC may be missing. Use one from eth2. et2macaddr="$(nvram get et2macaddr)" - [ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr" + ;; + meraki,mr32) + # The MAC is stored on an AT24C64 eeprom and not on the nvram + et2macaddr=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) ;; esac + [ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr" + wan_macaddr="$(nvram get wan_hwaddr)" case "$board" in asus,rt-ac87u) diff --git a/target/linux/bcm53xx/base-files/etc/diag.sh b/target/linux/bcm53xx/base-files/etc/diag.sh index 1a9332327a..bf5b779aa8 100644 --- a/target/linux/bcm53xx/base-files/etc/diag.sh +++ b/target/linux/bcm53xx/base-files/etc/diag.sh @@ -18,6 +18,9 @@ get_status_led() { status_led=$(basename $status_led_file) return fi; + + # And finally, let's also try the device-Tree aliases node + status_led="$(get_dt_led status)" } set_state() { diff --git a/target/linux/bcm53xx/base-files/lib/preinit/07_set_preinit_iface_bcm53xx b/target/linux/bcm53xx/base-files/lib/preinit/07_set_preinit_iface_bcm53xx new file mode 100644 index 0000000000..9e7c4b821e --- /dev/null +++ b/target/linux/bcm53xx/base-files/lib/preinit/07_set_preinit_iface_bcm53xx @@ -0,0 +1,14 @@ +set_preinit_iface() { + . /lib/functions.sh + + case $(board_name) in + meraki,mr32) + # switch needs to be out of the vlan mode. + swconfig dev switch0 set reset 1 + swconfig dev switch0 set enable_vlan 0 + swconfig dev switch0 set apply 1 + ;; + esac +} + +boot_hook_add preinit_main set_preinit_iface diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 40b2ef67be..cbb8290275 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -96,7 +96,7 @@ platform_identify() { echo "unknown" } -platform_check_image() { +platform_other_check_image() { [ "$#" -gt 1 ] && return 1 local file_type=$(platform_identify "$1") @@ -227,6 +227,25 @@ platform_check_image() { return $error } +platform_check_image() { + case "$(board_name)" in + meraki,mr32) + # Ideally, REQUIRE_IMAGE_METADATA=1 would suffice + # but this would require converting all other + # devices too. + nand_do_platform_check meraki-mr32 "$1" + return $? + ;; + *) + platform_other_check_image "$1" + return $? + ;; + esac + + return 1 +} + + # $(1): image for upgrade (with possible extra header) # $(2): offset of trx in image platform_do_upgrade_nand_trx() { @@ -393,7 +412,7 @@ platform_img_from_seama() { echo -n $dir/image-entity.bin } -platform_do_upgrade() { +platform_other_do_upgrade() { local file_type=$(platform_identify "$1") local trx="$1" local cmd= @@ -424,3 +443,23 @@ platform_do_upgrade() { default_do_upgrade "$trx" "$cmd" } + +platform_do_upgrade() { + case "$(board_name)" in + meraki,mr32) + CI_KERNPART="part.safe" + nand_do_upgrade "$1" + ;; + *) + platform_other_do_upgrade "$1" + ;; + esac +} + +platform_nand_pre_upgrade() { + case "$(board_name)" in + meraki,mr32) + CI_KERNPART="part.safe" + ;; + esac +} diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 768477160a..9ceb5f6212 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -320,6 +320,33 @@ define Device/luxul_xwr-3150 endef TARGET_DEVICES += luxul_xwr-3150 +define Device/meraki_mr32 + DEVICE_VENODR := Meraki + DEVICE_MODEL := MR32 + DEVICE_PACKAGES := $(B43) kmod-i2c-bcm-iproc kmod-i2c-gpio kmod-eeprom-at24 \ + kmod-leds-pwm kmod-hwmon-ina2xx kmod-bluetooth + DEVICE_DTS := bcm53016-meraki-mr32 +# Meraki FW r23 tries to resize the part.safe partition before it will +# flash the image. This is a bit of a problem, since resizing will fail +# if the partition is smaller than the old one. + KERNEL_LOADADDR := 0x00008000 + KERNEL_INITRAMFS_SUFFIX := .bin + KERNEL_INITRAMFS := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb | \ + pad-to 10362880 + KERNEL := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + +# Currently the only device that uses the new image check + SUPPORTED_DEVICES := meraki,mr32 + +# The loader is specifically looking for fdt@2: +# [ 3.190000] find_itb_subimage: error finding fdt@2: FDT_ERR_NOTFOUND +# The image won't boot, if it isn't found. :( + DEVICE_FDT_NUM := 2 +endef +TARGET_DEVICES += meraki_mr32 + define Device/netgear DEVICE_VENDOR := NETGEAR IMAGES := chk diff --git a/target/linux/bcm53xx/patches-5.4/330-ARM-BCM5301X-Add-DT-for-Meraki-MR32.patch b/target/linux/bcm53xx/patches-5.4/330-ARM-BCM5301X-Add-DT-for-Meraki-MR32.patch new file mode 100644 index 0000000000..29329eb3f0 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/330-ARM-BCM5301X-Add-DT-for-Meraki-MR32.patch @@ -0,0 +1,261 @@ +From ec88a9c344d9fd8c3b11bff1f99a0b6248ae256d Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 22 Aug 2020 18:19:23 +0200 +Subject: [PATCH] ARM: BCM5301X: Add DT for Meraki MR32 + +add support for the Cisco Meraki MR32. +This is a dual-band enterprise class 802.11ac access point. +The unit was donated by Chris Blake. Thank you! + +SoC: Broadcom BCM53016A1 (1 GHz, 2 cores) +RAM: 128 MiB +NAND: 128 MiB Spansion S34ML01G2 (~114 MiB useable) +ETH: 1GBit Ethernet Port - PoE +WIFI1: Broadcom BCM43520 an+ac (2x2:2 - id: 0x4352) +WIFI2: Broadcom BCM43520 bgn (2x2:2 - id: 0x4352) +WIFI3: Broadcom BCM43428 abgn (1x1:1 - id: 43428) + +BLE: Broadcom BCM20732 (ttyS1) +LEDS: 1 x Programmable RGB Status LED (driven by a PWM) + 1 x White LED (GPIO) + 1 x Orange LED Fault Indicator (GPIO) + 2 x LAN Activity / Speed LEDs (On the RJ45 Port) +BUTTON: one Reset button +MISC: AT24C64 8KiB EEPROM (i2c - stores Ethernet MAC) + ina219 hardware monitor (i2c) + Kensington Lock + +SERIAL: + WARNING: The serial port needs a TTL/RS-232 3V3 level converter! + The Serial setting is 115200-8-N-1. The board has a populated + right angle 1x4 0.1" pinheader. + The pinout is: VCC, RX, TX, GND. + +Odd stuff: + - uart0 clock frequency is 62.5 MHz. + - The LEDs are labeled as SYS-LED1 through SYS-LED3 + because of the silkscreen on the PCB. + - the original u-boot has been compiled with most functions + and commands disabled. The u-boot env isn't setup properly + either and as a result, the bcm47xxpart probing is not + working. Hence, the nand partitions are specified through a + "fixed-partition" binding. + - The "WICED SMART(TM)" Bluetooth LE 4.0 BCM20732 chip is + connected to uart2 of the SoC. The BCM20732 does not + provide a HCI. So the linux' bluetooth stack is useless. + The mock-up node with the compatible binding and + enable-gpios property is provided solely as documentation. + +Signed-off-by: Christian Lamparter +Signed-off-by: Florian Fainelli + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -119,6 +119,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm47094-luxul-xwr-3150-v1.dtb \ + bcm47094-netgear-r8500.dtb \ + bcm47094-phicomm-k3.dtb \ ++ bcm53016-meraki-mr32.dtb \ + bcm94708.dtb \ + bcm94709.dtb \ + bcm953012er.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -0,0 +1,197 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Broadcom BCM470X / BCM5301X ARM platform code. ++ * DTS for Meraki MR32 / Codename: Espresso ++ * ++ * Copyright (C) 2018-2020 Christian Lamparter ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4708.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++#include ++ ++/ { ++ compatible = "meraki,mr32", "brcm,brcm53016", "brcm,bcm4708"; ++ model = "Meraki MR32"; ++ ++ chosen { ++ bootargs = " console=ttyS0,115200n8 earlycon"; ++ }; ++ ++ memory { ++ reg = <0x00000000 0x08000000>; ++ device_type = "memory"; ++ }; ++ ++ aliases { ++ serial1 = &uart2; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sysled3 { ++ function = LED_FUNCTION_FAULT; ++ color = ; ++ gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; ++ panic-indicator; ++ }; ++ sysled2 { ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ gpios = <&chipcommon 19 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ pwm-leds { ++ compatible = "pwm-leds"; ++ ++ red { ++ /* SYS-LED 1 - Tricolor */ ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ pwms = <&pwm 0 50000 0>; ++ max-brightness = <255>; ++ }; ++ ++ green { ++ /* SYS-LED 1 - Tricolor */ ++ function = LED_FUNCTION_POWER; ++ color = ; ++ pwms = <&pwm 1 50000 0>; ++ max-brightness = <255>; ++ }; ++ ++ blue { ++ /* SYS-LED 1 - Tricolor */ ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ pwms = <&pwm 2 50000 0>; ++ max-brightness = <255>; ++ }; ++ }; ++ ++ i2c { ++ /* ++ * The platform provided I2C does not budge. ++ * This is a replacement until I can figure ++ * out what are the missing bits... ++ */ ++ ++ compatible = "i2c-gpio"; ++ sda-gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; ++ scl-gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>; ++ i2c-gpio,delay-us = <10>; /* close to 100 kHz */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ current_sense: ina219@45 { ++ compatible = "ti,ina219"; ++ reg = <0x45>; ++ shunt-resistor = <60000>; /* = 60 mOhms */ ++ }; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c64"; ++ reg = <0x50>; ++ pagesize = <32>; ++ read-only; ++ }; ++ }; ++}; ++ ++&uart0 { ++ clock-frequency = <62500000>; ++ /delete-property/ clocks; ++}; ++ ++&uart1 { ++ status = "disabled"; ++}; ++ ++&uart2 { ++ status = "okay"; ++ /* ++ * bluetooth-le { ++ * compatible = "brcm,bcm20732"; ++ * enable-gpios = <&chipcommon 20 GPIO_ACTIVE_HIGH>; ++ *}; ++ */ ++}; ++ ++&gmac1 { ++ status = "disabled"; ++}; ++&gmac2 { ++ status = "disabled"; ++}; ++&gmac3 { ++ status = "disabled"; ++}; ++ ++&pwm { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinmux_pwm>; ++}; ++ ++&nandcs { ++ nand-ecc-algo = "hw"; ++ ++ partitions { ++ /* ++ * The partition autodetection does not work for this device. ++ * It will only detect the "nvram" partition with an incorrect size. ++ * [ 1.721667] 1 bcm47xxpart partitions found on MTD device brcmnand.0 ++ * [ 1.727962] Creating 1 MTD partitions on "brcmnand.0": ++ * [ 1.733117] 0x000000400000-0x000008000000 : "nvram" ++ */ ++ ++ compatible = "fixed-partitions"; ++ #address-cells = <0x1>; ++ #size-cells = <0x1>; ++ ++ partition0@0 { ++ label = "u-boot"; ++ reg = <0x0 0x100000>; ++ read-only; ++ }; ++ ++ partition1@100000 { ++ label = "bootkernel1"; ++ reg = <0x100000 0x300000>; ++ read-only; ++ }; ++ ++ partition2@400000 { ++ label = "nvram"; ++ reg = <0x400000 0x100000>; ++ read-only; ++ }; ++ ++ partition3@500000 { ++ label = "bootkernel2"; ++ reg = <0x500000 0x300000>; ++ read-only; ++ }; ++ ++ partition4@800000 { ++ label = "ubi"; ++ reg = <0x800000 0x7780000>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch b/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch new file mode 100644 index 0000000000..fb78ee93c4 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch @@ -0,0 +1,28 @@ +From: Christian Lamparter +Date: Thu, 7 Jun 2018 19:29:12 +0200 +Subject: bcm53xx: add LED status label alias for Meraki MR32 + +add an led-status alias label. This is used by OpenWrt's LED +DTS lookup function to identifiy the indicator LED + +Signed-off-by: Christian Lamparter + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -27,6 +27,7 @@ + + aliases { + serial1 = &uart2; ++ led-status = &led_status; + }; + + leds { +@@ -68,7 +69,7 @@ + max-brightness = <255>; + }; + +- green { ++ led_status: green { + /* SYS-LED 1 - Tricolor */ + function = LED_FUNCTION_POWER; + color = ; From patchwork Sat Sep 19 14:40:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1367586 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209 header.b=pHO5HDvZ; 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=VL4Sq3mw; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4BtthL1qwvz9sRf for ; Sun, 20 Sep 2020 00:42:10 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ib+ICHREpWsSupp0n4iW9ywF9L+UjWmvd0VdSdPV9UY=; b=pHO5HDvZqXecikzPi0586j/Xn dXq4N3mggxklwpl8/3s9YClT3O8sjim6IPrZtzg9ZvC9C9z8TZVHY2ZtREqm6nywxm6gaZOp4szeT lJQrozyvjY2qUOgD+CQNcTda3SmwLRpFso6kZ9JKEhjQLs9Ndv56WK0wGt2jJj3VfRVTe614plb7P a6G0VU7MKFlpGTCMwj3zxAJzPuwS2WtFj+NdLka7kIYXbLyX1qYxlkBHHiIPzKh4xpz+inS8J49Qi 9AxIL18pFNww6cirxR2rYF7WrUGcTDczdKo22cpyqHCD8x0BNiF+0jar5hie41ielrVnpvlzgtrMs U8oxH39+Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2J-0008LI-DT; Sat, 19 Sep 2020 14:40:23 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJe2C-0008H4-J9 for openwrt-devel@lists.openwrt.org; Sat, 19 Sep 2020 14:40:17 +0000 Received: by mail-ed1-x52f.google.com with SMTP id a12so8689419eds.13 for ; Sat, 19 Sep 2020 07:40:16 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=cJjKNDvG0okRSyhqMFpyb1WJfdBmrI0wlvY9q69R0Oc=; b=VL4Sq3mw3ZoAB5ikdPaSpOghUkOt2xwUqkL+lPCr9i32CFtw3hwszFVe8ffPO6DbrN s3II/0eP5+2oqlGQB7p7Tu1op+WXGf/PYLNRwI35+eVsC7X6PIUyOFBwhRNCVWBCXtrE OWVH0xuCqrTH1iC2uOXKkdxP+tJCgBKIajhPu8EeCngGeBqvaMxdcvUJKrmc4wO4tfdK aO54EttBiEPu2NDsYeRwBdf3RmFHENTabW7muxYSCYnA7AgWLg9/KkYJB5A0WMx/59o0 HytczdzHnqI+T5uR2Fzzx1e+eXLmtkIGyWQ5GR7qMMMh5+upP2xzsgui/X3b1/MNBO5F PtBw== 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:mime-version:content-transfer-encoding; bh=cJjKNDvG0okRSyhqMFpyb1WJfdBmrI0wlvY9q69R0Oc=; b=g7ENtegEqeNF3n+vZL+39kYqKoLe97sHusvjahhefRfT7iaFBIo06Nqk9P3JrmHPlu kkWb7Hnn+QmZJGisKhCycecGGsZJ5xc7yeooNvctygu9YZnSrWZi3CAsq7HukIxwoJU2 3NG/SFVOOPG/EnERGotl0UneVhY1arceCazZ0YT/I51MwT3WIgNT/kTjxmMI69EzV5HM xmlT2JECPki5POGGOOnl5twj4/Z3yOfbjGie68nfOTny+RorpbxahqsULiM9ACaz5/Qs uxdDteG9CI2U1XViXX5BvD8dW8UMSdo1l6v1P7AZT7xO0UAunSC2gehuif0pR+lSd6cF +akg== X-Gm-Message-State: AOAM5322iRiK3v6RR3IIfNGC/1JHYXHj7tKiZQkB22TevlEiIztuN4At 83Cb5h4M0hZkUlqN6YJVpF8juI21vGZIUA== X-Google-Smtp-Source: ABdhPJz1l+cAknzJC/ElAh/8nLUmmUox3hIRXDiO+SRcIPvUpPoB2XoMCQ882h36FMaIpzcL1+g08A== X-Received: by 2002:aa7:d6c4:: with SMTP id x4mr43159955edr.98.1600526415069; Sat, 19 Sep 2020 07:40:15 -0700 (PDT) Received: from debian64.daheim (p4fd09180.dip0.t-ipconnect.de. [79.208.145.128]) by smtp.gmail.com with ESMTPSA id a5sm4690123edb.9.2020.09.19.07.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 07:40:13 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kJe29-000fT5-5c; Sat, 19 Sep 2020 16:40:13 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4 8/8] [RFT][WIP] bcm53xx: MR32: replace i2c-gpio with SoC's i2c Date: Sat, 19 Sep 2020 16:40:04 +0200 Message-Id: <54311329a56e7a38b1da6f61115543580f8fef18.1600525798.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <2a6d5b3755d1ba02cad0d8df46afdc0fcbb05b8e.1600525798.git.chunkeey@gmail.com> References: <6310f880aa209003fee9ef04add80176e249997a.1600525798.git.chunkeey@gmail.com> <8d4ccd9d499c7f080e401ee3828bdfb0e5733edf.1600525798.git.chunkeey@gmail.com> <3f47a2946d6fb8cd15356f03384cab25da52aec1.1600525798.git.chunkeey@gmail.com> <6738ae97125b563bc7f6655f9cf69f5ff1ac6e98.1600525798.git.chunkeey@gmail.com> <2a6d5b3755d1ba02cad0d8df46afdc0fcbb05b8e.1600525798.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200919_104016_640134_01822C87 X-CRM114-Status: GOOD ( 16.81 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:52f listed in] [list.dnswl.org] 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 [chunkeey[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -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.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafal@milecki.pl, hauke@hauke-m.de, f.fainelli@gmail.com, chrisrblake93@gmail.com, Adrian Schmutzler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org During review of the MR32, Florian Fainelli pointed out that the SoC has a real I2C-controller. Furthermore, the connected pins (SDA and SCL) would line up perfectly for use. This patch swaps out the the bitbanged i2c-gpio with the real deal. It can be applied once it works. Signed-off-by: Christian Lamparter --- target/linux/bcm53xx/image/Makefile | 2 +- .../332-Meraki-MR32-use-hw-i2c.patch | 73 +++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 target/linux/bcm53xx/patches-5.4/332-Meraki-MR32-use-hw-i2c.patch diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 9ceb5f6212..2d90665ee3 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -323,7 +323,7 @@ TARGET_DEVICES += luxul_xwr-3150 define Device/meraki_mr32 DEVICE_VENODR := Meraki DEVICE_MODEL := MR32 - DEVICE_PACKAGES := $(B43) kmod-i2c-bcm-iproc kmod-i2c-gpio kmod-eeprom-at24 \ + DEVICE_PACKAGES := $(B43) kmod-i2c-bcm-iproc kmod-eeprom-at24 \ kmod-leds-pwm kmod-hwmon-ina2xx kmod-bluetooth DEVICE_DTS := bcm53016-meraki-mr32 # Meraki FW r23 tries to resize the part.safe partition before it will diff --git a/target/linux/bcm53xx/patches-5.4/332-Meraki-MR32-use-hw-i2c.patch b/target/linux/bcm53xx/patches-5.4/332-Meraki-MR32-use-hw-i2c.patch new file mode 100644 index 0000000000..f61b9fdcdc --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/332-Meraki-MR32-use-hw-i2c.patch @@ -0,0 +1,73 @@ +From: Christian Lamparter +Date: Sat, 12 Sep 2020 22:11:12 +0200 +Subject: bcm53xx: Meraki MR32 use hw i2c + +replace the i2c-gpio provided i2c functionality with the +hardware in the SoC. This can be activated once the +internal i2c works as well as the bit-banged i2c-gpio. + +Signed-off-by: Christian Lamparter + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -85,34 +85,6 @@ + max-brightness = <255>; + }; + }; +- +- i2c { +- /* +- * The platform provided I2C does not budge. +- * This is a replacement until I can figure +- * out what are the missing bits... +- */ +- +- compatible = "i2c-gpio"; +- sda-gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; +- scl-gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>; +- i2c-gpio,delay-us = <10>; /* close to 100 kHz */ +- #address-cells = <1>; +- #size-cells = <0>; +- +- current_sense: ina219@45 { +- compatible = "ti,ina219"; +- reg = <0x45>; +- shunt-resistor = <60000>; /* = 60 mOhms */ +- }; +- +- eeprom: eeprom@50 { +- compatible = "atmel,24c64"; +- reg = <0x50>; +- pagesize = <32>; +- read-only; +- }; +- }; + }; + + &uart0 { +@@ -196,3 +168,25 @@ + }; + }; + }; ++ ++&i2c0 { ++ status = "okay"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinmux_i2c>; ++ ++ clock-frequency = <100000>; ++ ++ current_sense: ina219@45 { ++ compatible = "ti,ina219"; ++ reg = <0x45>; ++ shunt-resistor = <60000>; /* = 60 mOhms */ ++ }; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c64"; ++ reg = <0x50>; ++ pagesize = <32>; ++ read-only; ++ }; ++};