From patchwork Sun Aug 30 03:04:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1353873 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=BY1LJRde; 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=hAaTbzmo; 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 4BfJBg5GMbz9sTT for ; Sun, 30 Aug 2020 13:06:19 +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=o4sNPiShEbOEQ/GkesWDvg27ij04PqxOLiiGzK8uWMc=; b=BY1LJRdefotbMMT/MtdxHvCnmo byESgQ6P/c7+Qh3iZKx/mHeV5zaQXxILublHviFHzzgt+y8iea/illn37z8rLrSXizq81GLINBbFr +oeJpsK0829MlXECh0FtynPKrYsUhnwdcwFbhw4rqFIl5gilyfwaUUm3nFVKZTerKUVIHhgrM4ObD /yEiz4RRP+41ks9i9u2LTaaBSzLlICtvA2AE7UNKTAD5XCQLffvprxP1J2FH1sZGubkOqsNtipRyN tvxo2HeWKDqXjMJEO56nFMaH+Kv8bXQQIiWaY85PGZO4Rxb+2Zt1L0U5W8b2OYUJKqeg28ste7DQn tdIOXFvQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdu-0004ge-Br; Sun, 30 Aug 2020 03:04:30 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdj-0004d3-LQ for openwrt-devel@lists.openwrt.org; Sun, 30 Aug 2020 03:04:22 +0000 Received: by mail-ej1-x633.google.com with SMTP id m22so4058597eje.10 for ; Sat, 29 Aug 2020 20:04: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:mime-version :content-transfer-encoding; bh=NWCQEB7ohb1EInfX+ybc7Hh5vKIFGtSwsbpy9r7BWtE=; b=hAaTbzmoiECYJX2SzzRoWifGGEEuz7QMhCqaFFtZ65AJdESqn8lIq3kzDDwtZR3oNZ ckQTixQEyQj/SFotZjPnpFn3idnqUyOCUY2GG29kYrP0T6g/55rW5ExMCxYZDrlNxUd2 L3f/h3k+FhZR+Wq74VkeDO1Gkvyf36x7NFvw4qP7WJIoaAACcfepurRu95PNRAk2f4sN yioThBITocz1FdLb8SPZTmQeyVxkgT++B1chCuYOcO+XT5+vba2qj+w7bP3xQuP49WNM NWt4O1+QyVRARvNkPQhwbcg8aGzjUemORVNCGNiCAnVWPG24bqy0ei4q9wtdQ5qEjqsN ZZzg== 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=NWCQEB7ohb1EInfX+ybc7Hh5vKIFGtSwsbpy9r7BWtE=; b=R6TIpCjYEsj44Ug4TOozODFbjmK6wPbvdKD42zxdzIXMC1fdHm3t/lInD2KTPMz8ie /F8+DrgWyltrUChrKwovg+kvJySiXUAe2fGObZKsTrsZkwoySc5K7lefUwEvCwXa+G2g yn6080nLWr2Rb2Ad41WZRVOecE1Bv5Wu2nLTMDZUlbR84v/5GK7yWAvXuo6w4OMeukBO PwGEHyLAXSbF9TqTbO2IfCpdHjB/rK4YdHla+9EkUvDNZMJcW1+lTDM01vopDKrj/3r3 BJlZTlsdNmbtHRdsN+4ICZjzdYB8SjiRfZvy1tE0KFuCtN70xlEaEha4MKEYJ6niiBAx VXJA== X-Gm-Message-State: AOAM533IVkFEjyHAqAQHZ/mY5eVuq/wFPMpToFdr8BjhZH6K1sn3SQFY 5WSjmb1/aXKtYZd6Un3daLhMY1sUQok= X-Google-Smtp-Source: ABdhPJwlVCi2BLtUzi9QM/hppulFuEJVK2cCw2VIKGkDm8h/AHFnsG9tcfj0VWk7k9qvNidnfVHmAA== X-Received: by 2002:a17:906:440c:: with SMTP id x12mr6125418ejo.293.1598756657326; Sat, 29 Aug 2020 20:04:17 -0700 (PDT) Received: from debian64.daheim (pd9e29952.dip0.t-ipconnect.de. [217.226.153.82]) by smtp.gmail.com with ESMTPSA id d6sm3761040edm.31.2020.08.29.20.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 20:04:15 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kCDdZ-00HNUD-PJ; Sun, 30 Aug 2020 05:04:09 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v1 1/8] base-files: support label-property-less in get_dt_leds Date: Sun, 30 Aug 2020 05:04:00 +0200 Message-Id: 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-20200829_230419_777918_49DC413A X-CRM114-Status: GOOD ( 14.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:633 listed in] [list.dnswl.org] 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The "label" property we used and loved has been deprecated upstream by: |commit c5d18dd6b64e09dd6984bda9bdd55160af537a8c |Author: Jacek Anaszewski |Date: Sun Jun 9 20:19:04 2019 +0200 | | dt-bindings: leds: Add properties for LED name construction | | Introduce dedicated properties for conveying information about | LED function and color. Mark old "label" property as deprecated. | | Additionally function-enumerator property is being provided | for the cases when neither function nor color can be used | for LED differentiation. in order to be somewhat prepared, this patch adds a fallback as a last resort to get a proper label based on the node-name. Signed-off-by: Christian Lamparter --- package/base-files/Makefile | 2 +- package/base-files/files/lib/functions/leds.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 7eb3ac1868..2419849a44 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=227 +PKG_RELEASE:=228 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/functions/leds.sh b/package/base-files/files/lib/functions/leds.sh index 43b2fe02ed..14baeb37b4 100644 --- a/package/base-files/files/lib/functions/leds.sh +++ b/package/base-files/files/lib/functions/leds.sh @@ -18,7 +18,8 @@ get_dt_led() { [ -n "$ledpath" ] && \ label=$(cat "$ledpath/label" 2>/dev/null) || \ - label=$(cat "$ledpath/chan-name" 2>/dev/null) + label=$(cat "$ledpath/chan-name" 2>/dev/null) || \ + label=$(basename "$ledpath") echo "$label" } From patchwork Sun Aug 30 03:04: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: 1353875 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=MQFlFTPt; 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=kWcjNfdD; 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 4BfJBj1Kqvz9sSJ for ; Sun, 30 Aug 2020 13:06:20 +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=zuAKLzJL7WLIurm7tjxfsLE+IJArAgy/hN2FFzkBwA0=; b=MQFlFTPtU21JQkTTK5npQNHYd GJFvyyfMZuWDViAUAf2XzUi1SkY1lGZ1OA4KpZzOWiWLsaaZx6FLtITrs+vjBv7AGseBR4fAWpG3s uPotPgsBjgkQq9MccAfsF8GHRipNlqiI9tx3/vQ2bDQFv+soHSCpQ8QkVOpNyoEEwJWSKllaxH0rh mRoMlS1v5jnMoPSPmgb32ktP0WHPqe9kBuMcCH2oAjLbrKNCCq2YHLUYTihT/BstTCh3HRDsMgxJ1 Tk2IixkFYL1YpsfFZG5sHrWmgfXc0SZnXVBOi2Z7WxgHHKQ6CLkpvcR6gLzI4LrUYPO2OZ2iz7fs7 D+lkEHZHg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdv-0004gs-G1; Sun, 30 Aug 2020 03:04:31 +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 1kCDdk-0004dN-31 for openwrt-devel@lists.openwrt.org; Sun, 30 Aug 2020 03:04:22 +0000 Received: by mail-ej1-x644.google.com with SMTP id b17so4078647ejq.8 for ; Sat, 29 Aug 2020 20:04:20 -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=/leJiTBLMfUNSJZeifCf7p03He4tZuF+EhrchhzOrVM=; b=kWcjNfdD9V2RBKk+D2h9KeixP+fJNpa8m8DHSSvV3Hk2rQD3SConOSapMllzXlr5sn lmPd7HUdNt0Ay1EjxDqOR39c3URtDv5RW7RFYY/NIS+M26x/DC2MqFPAE3way1YjHxu5 6Vq+AZu/SOD39eia2sXptn9MC9KjH3ac9vvkc5LRMuOIoq0J0ABo83EyppfK/YDx2X3B Wfcq+k3yb8hwEqDtsg48yG5zQNNnZ5iA4d1OjkDfgZ+I+3wanMzskrjK0UG4Olp++LNZ 5dhYPdOQ1vildOtV9/IP3n2eUnGmwaA6uH6pwrmWk99F1aQOGBXa/dGSPoN0b2se204x sywg== 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=/leJiTBLMfUNSJZeifCf7p03He4tZuF+EhrchhzOrVM=; b=V70NDcfFuVe61RTCFGpcJkZU5rC7q+hSlaAMEqTp+kuuy0p4PIMO7l3Kzx7QErA6tk d11h9ZNytMEyDUNP3i6fCidTtO4DTUTl+yCEyZt/am+jaeU4wsdE657g5zQSLNgCzjke dnfzP/TYe1txsx/RSqZucurPSGitsL3Gvnag5ySZD/ACQZOtLoU7J8l7revjwfpxuPX3 CPmntfOzNjHTxsWAs9awn/74zVkCS0hBUvXHA2WY6Ir4QVR8Hqag8Tk1wOP0P8cKHstl XA1vCd0tdEY+e2OZ4Aip6u2TJ6hwtfkV46rsL+5sU5z6LiKzHpvQ4H+IsoezUHcshZNh B8bw== X-Gm-Message-State: AOAM532H3tS1f7NRLIXgU4nXoBh6eDSu6C70v8k20y+aJ3UwjspQbX4s c6+KojxvHxetgn4pziEfG6PgNkguR6s= X-Google-Smtp-Source: ABdhPJwOZrxbyRbzrZKO9aCbHC9CjoQYg2JRPIORoxihd457OP9TyNR9wUMVh6v6O/3/VkKyAQk8Og== X-Received: by 2002:a17:906:3b4b:: with SMTP id h11mr5821687ejf.381.1598756658975; Sat, 29 Aug 2020 20:04:18 -0700 (PDT) Received: from debian64.daheim (pd9e29952.dip0.t-ipconnect.de. [217.226.153.82]) by smtp.gmail.com with ESMTPSA id u3sm3931822ejt.28.2020.08.29.20.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 20:04:15 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kCDdd-00HNUF-RQ; Sun, 30 Aug 2020 05:04:13 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v1 2/8] scripts: mkits.sh make it possible to specify fdt@# Date: Sun, 30 Aug 2020 05:04:01 +0200 Message-Id: <86b848dda7f3d40b68ab4d1f78286b293d9f9b21.1598756597.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200829_230420_213014_B8896DC5 X-CRM114-Status: GOOD ( 15.19 ) 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 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 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 e8c2cf7100..2b48b8693c 100644 --- a/include/image.mk +++ b/include/image.mk @@ -415,6 +415,7 @@ define Device/Init DEVICE_DTS := DEVICE_DTS_CONFIG := DEVICE_DTS_DIR := + DEVICE_FDT_NUM := SOC := BOARD_NAME := @@ -436,8 +437,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 Sun Aug 30 03:04: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: 1353870 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=hVj0qjc1; 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=uJkxMNaE; 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 4BfJBd6tPPz9sTK for ; Sun, 30 Aug 2020 13:06:17 +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=0Ycx4t7cGRgw6A/CUmtQ2zXW6diVOpoMXYxm0c3aF20=; b=hVj0qjc1du/YtObV0dy705fJ4 l0vgvJ1KJ6RklC+CnaTPkMt3FhPaJLRf5azOqimoJaQOnEgDkYpI2be/BTtwvtk26PvdgYny0ZrGq v/c5+7Xb1Fp6oaIL0EcZgEFHXS98mHEgxbJGw2EbiSUv1F4rFI5Ukek7lxqn84+jUPqDWf2rVm+Q4 pCTeQYZKqUgzl0/Znk2oSJckbSJUcbzgtM+R/l5QBV2YCmEHcJbA7uE6Cj8Gfnnj0D0bDM+zjbDrJ UrEq/9pHx2fUKXbad02rYzYCg6kt0RsXdvFJqEntbiLAyl25PRcssI959wGSp/tUKQ2nB2ydzvhT6 Xqyxk8ZhA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdt-0004gN-5B; Sun, 30 Aug 2020 03:04:29 +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 1kCDdj-0004d6-Id for openwrt-devel@lists.openwrt.org; Sun, 30 Aug 2020 03:04:21 +0000 Received: by mail-ej1-x644.google.com with SMTP id d26so4137175ejr.1 for ; Sat, 29 Aug 2020 20:04:19 -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=plkyChRYQemYMPMAQkvCzGGHu37XHtsxX+W/FJkJQRY=; b=uJkxMNaEwGIhiXwugaQKOH1srTedv6PW/884DOQ2AO4lJd58eWfd3834ZlDxcvDTf+ x/qoHUQWICfpKyIHl1qHj64H5X5dPJ9DTLRZjjvOl9gfYIbdWvs09WNUk62JlC/hjZPf ncRHOQTftTfUFwQrBRBKfWATKoNsv/KGwhaEK4Rvz2h0w9emN/OOLWL0HAxFKw9O3p1A TuX8DdY5if+sFbBcjjWcmXxTvgw+FDNx4/Q6gDrD9327piZjXn7lFCPauReuAy9If1ke 7eEdtipiQEvFH6A3gVDO1AqUgcwqhJOJFaLTEkZrhMw5uzUraUhW4CpOrwJXub7i30r/ I57w== 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=plkyChRYQemYMPMAQkvCzGGHu37XHtsxX+W/FJkJQRY=; b=XUect2pOQ4r1VeKg7E0cLsLPWR7tWH9zji4fVLoHQ1sW0cGepOp2Fq/aZuRHAmYovk 3dL6WsjBIQluON3rYBCT27gU/2Zdpf0NVBWBDEMoqBzPo5KTMjQKlAQkrVkg2uZH5/0s 44xTw4dN414HrFeqHr3wEGQSeyBs231SjYfhipxTndCdkS1cOtwBLf8TP9pEFzvEIAiV BH8V0y4Rlh7b3TXV30GGTLXBoNz0SLKbfMCYpAyIYQ8X5MCi0t0StiQzn06SfzmWjXKs MZqLBb4obwJPWp7TK46hhrurvRG3gvUWE5lAaTmD7b9JuksdjJiPuAnB0jVfu5zEpL10 y5Cw== X-Gm-Message-State: AOAM533nPfLnEilcXfxtHvAsqw71vI3WySYoV9xu0VDVO5G/H7fRrpZy qmlZW0ZOqOaZECHe1fWuH7bYtciwnQE= X-Google-Smtp-Source: ABdhPJwv5g/lwnAjF5j1QB+CPLy2BFXxIdbx5iaOmcYjHk/8QlQ7p+aGFP3h9q3EAqlxvLyfya/6Xg== X-Received: by 2002:a17:906:dc03:: with SMTP id yy3mr6164016ejb.380.1598756658456; Sat, 29 Aug 2020 20:04:18 -0700 (PDT) Received: from debian64.daheim (pd9e29952.dip0.t-ipconnect.de. [217.226.153.82]) by smtp.gmail.com with ESMTPSA id d15sm3623412eds.75.2020.08.29.20.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 20:04:15 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kCDdf-00HNUH-2K; Sun, 30 Aug 2020 05:04:15 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v1 3/8] build: define PWM_SUPPORT arch feature flag Date: Sun, 30 Aug 2020 05:04:02 +0200 Message-Id: X-Mailer: git-send-email 2.28.0 In-Reply-To: <86b848dda7f3d40b68ab4d1f78286b293d9f9b21.1598756597.git.chunkeey@gmail.com> References: <86b848dda7f3d40b68ab4d1f78286b293d9f9b21.1598756597.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200829_230419_751360_7204D177 X-CRM114-Status: GOOD ( 15.33 ) 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 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 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 59ea6edbcd..4ef64fd907 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -145,3 +145,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 Sun Aug 30 03:04: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: 1353869 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=Tr6S/XEx; 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=dhDF0sRz; 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 4BfJBd5lGPz9sSJ for ; Sun, 30 Aug 2020 13:06:17 +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=Gl27vNiyZT58SHU7Ez8cAZj0ON28AEXvElxVQj3k1PM=; b=Tr6S/XEx4A42jwtyd/7GvPJq/ QPAn/Qdt2IYt52146yVcVQ2F9Y8t+G4/UJm9Arp4buWt+nGysl8+oxAFYIgj0TkXQV1doFwqttryD Qq4kBktaHuf+AqL3Zv/MNHEbxzyn7P6OPQ4zSou6mhQjVw7KgwAirOHiJim0Y08XdhkaVwNipAxMu kdIPz81lwiEfPnlSFnd29kUQBQ89A2FFGpZMR+hcfFGl5h9J78xMZQvwj6xU+UQaCEYV8JCbmNIpO MesZuNOMFiotaopp/UpLnzGKA1wjf5bT4OgEZW6eA++aIbMzOzgyUE0u25XNW72d7oK1ywbDH6coD UxQOMj/Xg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdo-0004fa-4g; Sun, 30 Aug 2020 03:04: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 1kCDdj-0004d2-GJ for openwrt-devel@lists.openwrt.org; Sun, 30 Aug 2020 03:04:20 +0000 Received: by mail-ej1-x644.google.com with SMTP id s19so4091664eju.6 for ; Sat, 29 Aug 2020 20:04: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=HL6JSJX6Zlljl/KWDJaDyRjzv5TI711yCPK6ZmrQkv0=; b=dhDF0sRzW/tozhkkLXayTpvy+gMW+N8csdanfu+5LZjSDzNyrkchZL4JQzog05Phcl eGt8TgnEubMZ0arozVeJDyzo0wJ51qcB3yr/TjWT+LzSxwQaewwdA0R0Stv9WhFa8j0F oU8EXZBKyrzAwfsxu27HricDdsPvTOfG9SCtF4EmCSPapO9EMRVWr4IbYyzJ2F27eSeU AmDmfpLOaLlZaQTNj/hq16ekwFcn9xv6eCekzPqumgxPcxABkYdtUAb/6FtA9Cb10YE4 LI1aziCVBckwAyN0aRB2R+dAXjRpLJvRsnbYMmCpcH5U8eraqHVRxBULb4W4OrY8byJ6 j+KQ== 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=HL6JSJX6Zlljl/KWDJaDyRjzv5TI711yCPK6ZmrQkv0=; b=Z3j/PvqZnVZaLN7rNdxpwh7laL87pY3V/VFo7GYvTnytXmKzcMrEEdes5h+RcPNjh/ +UZyVuMo+V+NSKxK8SRclvebcQJ5ReV66fZ2yFJTxiBK+5k1H3grvEmmbGym5NrQ2/or KaEgRMaC/yiWuTU/l5mOt0sfY4NNshl5QD0yIsbwm9TqsPC0hKxYOrXsbrh9wZQgmPz7 Jl2spsuD/Qq01UzdGwryxa7VSt8E16wvSHotVVFtcpEL9ZPyupGLv1T8l0bUoLqvyGiP 440Xn5tRx7YlKI4U1S8ouhm3G0pRtaGl13UQx9Coa2WVVJTuN9KHTHJw2A/GPyVQ4GjZ hZIg== X-Gm-Message-State: AOAM533kCet9vSu/HVhvLFrjUN0Px4SEr0skfexkse4nCemzUjCqkedS oStri/U62UL8v17yEZBTQ+vnGwXvWwE= X-Google-Smtp-Source: ABdhPJz8OoTAty5/5kDbjObZvVgPnLG2NgOXmyDx9DNveaii6WBKVSKmdVEgPaxmhRh4eoHdohEvAg== X-Received: by 2002:a17:906:2704:: with SMTP id z4mr5776979ejc.350.1598756657021; Sat, 29 Aug 2020 20:04:17 -0700 (PDT) Received: from debian64.daheim (pd9e29952.dip0.t-ipconnect.de. [217.226.153.82]) by smtp.gmail.com with ESMTPSA id l10sm1661143edr.12.2020.08.29.20.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 20:04:15 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kCDdf-00HNUL-3Q; Sun, 30 Aug 2020 05:04:15 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v1 4/8] bcm53xx: enable PWM for bcm53xx Date: Sun, 30 Aug 2020 05:04:03 +0200 Message-Id: <6a9a870c4f76b8cde58f28b5c77f54d8222af5e1.1598756597.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: <86b848dda7f3d40b68ab4d1f78286b293d9f9b21.1598756597.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200829_230419_585417_5B507647 X-CRM114-Status: GOOD ( 17.91 ) 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 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 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 --- target/linux/bcm53xx/Makefile | 2 +- target/linux/bcm53xx/config-5.4 | 3 ++ ...M-dts-BCM5301X-Specify-PWM-in-the-DT.patch | 45 +++++++++++++++++++ 3 files changed, 49 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..d7b871bde4 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/033-v5.10-ARM-dts-BCM5301X-Specify-PWM-in-the-DT.patch @@ -0,0 +1,45 @@ +From 9bd34833986d4af180c6d75a326edb933a17de31 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 6 Jun 2018 21:01:59 +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. + +Signed-off-by: Christian Lamparter +Acked-by: Scott Branden + +--- 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 Sun Aug 30 03:04: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: 1353874 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=m9/ol7+j; 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=etuTtQHQ; 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 4BfJBg4psLz9sTS for ; Sun, 30 Aug 2020 13:06:19 +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=GevuJ91TqG3Zwrs7lhPm3LotNL6RCg2+avHFllL0j9U=; b=m9/ol7+jbu1817PDOimI4VpJv qcPkyEuH1T4/jzIgHCPWA3UdQSBbI6L/kdraTZ3QWLrTgWr0c/YF0bSKJkgf/VXRgRVpbUSqEHgZ9 4pTWIkSDgoV7/jd6cvG9ZBF7B8254M7TNJhy9JEYqw0h/iyCtCAy21rLNQT8vm6/ozkXnI2LIDd98 Ox9ORCpgL5c0W/oN7hmORVDk5JIQ3GymVV9AwyblDhLTc4q+fI9dtyUoMCgyGyTSsvNbdTNwev0qY BPToplQ7Rn7G76Zd6+iaY/2+dbnWfrbOAcQ9wttTUspBuT7WRoMol8YUKJocT/cEQ0zlsYts0ixrB 3E3NGqxgw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdl-0004f3-Hg; Sun, 30 Aug 2020 03:04:21 +0000 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdj-0004d1-5Z for openwrt-devel@lists.openwrt.org; Sun, 30 Aug 2020 03:04:19 +0000 Received: by mail-ed1-x543.google.com with SMTP id q4so2488361eds.3 for ; Sat, 29 Aug 2020 20:04: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=RffDWVbJPTLVEZNXc4WKdtd9m/XU7tOxKjkS0crGyT8=; b=etuTtQHQpNVMIZ0DMDBtAQzREqNOuX2H4RRzQhgysXtsNyxlK1PYBBG6UxOA6ENR3P /PfPdcBpk7XRXxOhTZ5OkgWGYmtbUZMQBAcaD8rSY6hL0h8A1aRFgGmXq/m7bhbELQV7 uMoWXT3k7YGvlbAegdxBWlGWkP8zIVn4rj247SSArD9+aB9LUQpkQGQV6jf2jNeB95WU Bg9I/BbHCJDQhq4VsCzurRCbwoy3m8CiGToImEIeeVdOrKqF+l5vANpHPjS8nSuiR1ME GtLXWi1wjbRSXPluJXeoGBpA4EiE58av4Nqh7byaFzEf07651+gfP33REQzLSIAuVHZq Nk7w== 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=RffDWVbJPTLVEZNXc4WKdtd9m/XU7tOxKjkS0crGyT8=; b=Y0EfqwwghlXJgN6qWUG4QFMqq53NDhYdkWOPfZHfBN/H6TTN0G7Dg0iVJepxIibVHP phbJ6xLFgMYtNvUrEbIYJyCW2f4RY6i613QRV+eW/mF/uW6DnuF+TmM2juiO/WPxn5R/ wNUq/1kxX62oBHHoqxRW9hS4/nrf/sO8wIWQlTnSsoscLIS8tI+B0q2nmqOBu8dT43hi ifya1H+dxn7fuX/D0OcewhCH3NrjuOrLuFOzKm9jFw47t8xBSaD7UV8Kvpkc1SW7BjfJ yhiCaG6Y4hUavgI/m8rJ7Y+ttk9VfkRjq6ro3bP5b+MOXrD4ATcAUrvibT0zWN/npXax pSJQ== X-Gm-Message-State: AOAM533ei54wQ+4Sro5NJGY3AoUmQMSFPEkEr7caA3R1/y6DU+ySaYSt lYVCQpTfj1oJxRBBlSQYieX7KlNK/M8= X-Google-Smtp-Source: ABdhPJxbyvB7vgrtpcWgh29Yo+nEwjd6UHwJ5GrIfuH8QcJsiuitgESJijr6L31qPsZ9n7hF6sEXWg== X-Received: by 2002:a05:6402:16:: with SMTP id d22mr5879296edu.175.1598756656751; Sat, 29 Aug 2020 20:04:16 -0700 (PDT) Received: from debian64.daheim (pd9e29952.dip0.t-ipconnect.de. [217.226.153.82]) by smtp.gmail.com with ESMTPSA id cz21sm3723827edb.45.2020.08.29.20.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 20:04:15 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kCDdf-00HNUO-4d; Sun, 30 Aug 2020 05:04:15 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v1 5/8] bcm53xx: backport uart2 and pcie2 device-nodes Date: Sun, 30 Aug 2020 05:04:04 +0200 Message-Id: X-Mailer: git-send-email 2.28.0 In-Reply-To: <6a9a870c4f76b8cde58f28b5c77f54d8222af5e1.1598756597.git.chunkeey@gmail.com> References: <86b848dda7f3d40b68ab4d1f78286b293d9f9b21.1598756597.git.chunkeey@gmail.com> <6a9a870c4f76b8cde58f28b5c77f54d8222af5e1.1598756597.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200829_230419_244161_62B087EC X-CRM114-Status: GOOD ( 16.16 ) 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 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:543 listed in] [list.dnswl.org] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org These have made their way into -next. Signed-off-by: Christian Lamparter --- ...dts-BCM5301X-Specify-uart2-in-the-DT.patch | 37 +++++++++++++++++++ ...dts-BCM5301X-Specify-pcie2-in-the-DT.patch | 33 +++++++++++++++++ 2 files changed, 70 insertions(+) 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..1fec981146 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.10-ARM-dts-BCM5301X-Specify-uart2-in-the-DT.patch @@ -0,0 +1,37 @@ +From 95c1f0076303922ca401851b6605dc17eb0eb732 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 6 Jun 2018 21:57:15 +0200 +Subject: [PATCH 1/4] 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 +--- + arch/arm/boot/dts/bcm5301x.dtsi | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi +index 45cd8c7411dd..eb1290fed235 100644 +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -392,6 +392,15 @@ usb3_dmp: syscon@18105000 { + 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>; +-- +2.28.0 + 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..d4ec31c0ae --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/035-v5.10-ARM-dts-BCM5301X-Specify-pcie2-in-the-DT.patch @@ -0,0 +1,33 @@ +From 5abb709b027a6234c135843764bad383be264162 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sun, 10 Jun 2018 17:17:53 +0200 +Subject: [PATCH 2/4] 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 +--- + arch/arm/boot/dts/bcm5301x.dtsi | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi +index eb1290fed235..9d9e8fe3f6ae 100644 +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -252,6 +252,10 @@ pcie1: pcie@13000 { + reg = <0x00013000 0x1000>; + }; + ++ pcie2: pcie@14000 { ++ reg = <0x00014000 0x1000>; ++ }; ++ + usb2: usb2@21000 { + reg = <0x00021000 0x1000>; + +-- +2.28.0 + From patchwork Sun Aug 30 03:04:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1353871 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=cqSPK8V+; 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=eq5qWLzk; 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 4BfJBd5tLkz9sSP for ; Sun, 30 Aug 2020 13:06:17 +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=nGy/WW3sGZUHBWOisNA9NFys6mbfRAnL/cGwH9zAMms=; b=cqSPK8V+b5D6hbLWYMrbBZNqS 69+YleTRljF216TdBNRxFcSxigDqnGv/AVc/0NkR0KRpsLfygpbEg3lrUaIntCX9/6YH3iGQDiBmH B3P8EL0BcfdztScfZTM5PiMD4OPX0tT7uY8y7oQHuhl/fkwCycr5mwa8aDpt11aPtmgjaImmZQGQJ Axl2wiI93iEVugIe3yASGmELSstcvnHw1q7giRGRZP91328MUAG8GGoqjFwBqqV6Cxtpdlcw+fv9C h2kOzJMJBRtN4FP+DE8wYCJ2fVxT9gu33O84AWPpJoOIo84AJX/HRofwyuJ2CXqKbgEnp579YtVab n9RH1P5Pw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdp-0004ft-DS; Sun, 30 Aug 2020 03:04:25 +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 1kCDdj-0004d5-IY for openwrt-devel@lists.openwrt.org; Sun, 30 Aug 2020 03:04:21 +0000 Received: by mail-ed1-x52f.google.com with SMTP id ay8so2467178edb.8 for ; Sat, 29 Aug 2020 20:04:19 -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=tTL7NXGQDgf/JvvS/peKKRfRlVMEJ2bBEMUvpAgISZU=; b=eq5qWLzkVUq7dt/aioVrNa5TFosfocsUX0OjZJIlt+OXvRPRteleC9vwgclx+f/llx gzQ++kZo4HOXcAUhTg5dA6T3O4sNBfmSuU0Fky1DkxkuIyuJo6neFYf/eLGVAXNwJVDt XbStTjLqRMwniJoYFcqL2SZfS/vZIn9JelJ4bUb7TgGSKowOygIlEfsV2226wwQcYbvk NWlfVL3hasuWoy8pD1lPHrMGU224EkBcIDRtskEKc0Qgg5DyM7x6awmH02OlcfPEXw5S NSmO8OOe0QsmaLEINtnMoNYXxnHvly5jqXHiIXe++qLIDx/cxiMe6Q3wXo5y+AvqHHxI VLIg== 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=tTL7NXGQDgf/JvvS/peKKRfRlVMEJ2bBEMUvpAgISZU=; b=fRJOqScKbgvmsG4TPNDmNC9suV7ntzt4zqg7KN7M/o8gWE90sBOkP5vF9G/gXhCzKi gco19y/art1Us1/Hn6IHAHFavL0BOpIgtqqraUedfpUH3tsHBTN8/aON+61MMFO6+g/D rjfBRbRmeyASBzo1wL0FngwVAxEKx9GcrHW5TfD3JsvMixKhHhMr5FRUki3O2zYGSWSi 28SYEwd8yxJL1E1aOuPOQtA3aOFzOphNxHvRFmA2lfzqsKst4ZahAUr24KQHPmdxrIZs AmWL3d/mlAWEbyHsviQpwgpBTyyjNLFHNDiKoPUILfTyoWnfiSfiW71cp6VDq2Kyxi0F Fs1g== X-Gm-Message-State: AOAM531h+A/BNiF5k5/xgZ42UF7uvy2ZG571M+SO6yHY+i8ZoPxgzSBI RA66QAbl4R9U889/CEWGRznod9Mke5c= X-Google-Smtp-Source: ABdhPJz0N/u3ZZrrUHMFdDINqCGGjkg1OfeilJvxtD8CIdeEOEepkRYPaI26ZONhWvSBaBDj9Ha6IA== X-Received: by 2002:aa7:cd04:: with SMTP id b4mr5558064edw.254.1598756658157; Sat, 29 Aug 2020 20:04:18 -0700 (PDT) Received: from debian64.daheim (pd9e29952.dip0.t-ipconnect.de. [217.226.153.82]) by smtp.gmail.com with ESMTPSA id la17sm3509509ejb.62.2020.08.29.20.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 20:04:15 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kCDdf-00HNUR-5P; Sun, 30 Aug 2020 05:04:15 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v1 6/8] kernel: add default for new config symbols Date: Sun, 30 Aug 2020 05:04:05 +0200 Message-Id: <0e1fb52045b31e351656de541cd0188ed7c6ba93.1598756597.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: <86b848dda7f3d40b68ab4d1f78286b293d9f9b21.1598756597.git.chunkeey@gmail.com> <6a9a870c4f76b8cde58f28b5c77f54d8222af5e1.1598756597.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200829_230419_679244_1E5A0D4F X-CRM114-Status: GOOD ( 12.69 ) 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 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 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 19bde7ed61..5612a7500f 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -2114,6 +2114,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 @@ -2374,6 +2375,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 Sun Aug 30 03:04:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1353872 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=X47RpItX; 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=uN+7nF3g; 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 4BfJBf1770z9sTM for ; Sun, 30 Aug 2020 13:06:17 +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=lHcISjV2+aO7blhNe0exhs+OoN+wgECySnXZZ/GlMlY=; b=X47RpItX5Jv5AeIAphtKm1rF2 BUKbP4XIEREckvbB6rkgWvA7HDT9DUZXXwY7/Ay7v+W1TFLbjvyjKHstkm+zlwOB4YNHmZyEuZnJw cXkHf0Qwds/xkJar0I7uvmqLAbyhRLt+a2DDjE3K54HcQNE2xCowr63UPLePoIKaFHbSbgFmxny5x XwJM71DrvnTZqe/7eHbWqUSE+i0zTyaCiKzQboldQh417+wEPF5KrnnEpyGDdZ4IdAgUZjOd7LBxk XnpG06QM0YrYJBWUhoAuRItP9HRrvvZpRB4OL0OqsTD/ebdEiDuKqUeYKNiJJ9ti/eUf0r+gJr8wB blzF/FmjQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdx-0004hM-BC; Sun, 30 Aug 2020 03:04:33 +0000 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCDdk-0004ek-Pz for openwrt-devel@lists.openwrt.org; Sun, 30 Aug 2020 03:04:24 +0000 Received: by mail-ed1-x543.google.com with SMTP id a12so2444758eds.13 for ; Sat, 29 Aug 2020 20:04:20 -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=741f2gIg5pkHx0yff9eNku16/MwsEBQNIF8eYSb3QvQ=; b=uN+7nF3gRxA3kxFcKgQWr++rrI2XVzgn6Ndao0O3iJUjGHByeT2ZytGhanEdVdNgNq ZLg7B5vZDHo6lcWC3cMd0r9k4MFL79+sgvQexGzTeBuV1l3/ByhVaWm5tzpyy88nDzBH 63dOH8ira70jWDtCALOoBoBaHv7/IUZ5lfdoFy3wuNYPgICvyiQkuC3DpI4gG8dlUV+1 V0Me5oCs3jRSl2twCrlP06AWXM/i1eti+2Tkxsfj7c18sKwxBIxhtCWDzjy/oMbUs2UA 2/+p7IoJvg9M3U4qOEmGVc8K7eKav+rH6exP4op5xAoPujeoBVAdke2vvLhEYMQbcDhm KR/Q== 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=741f2gIg5pkHx0yff9eNku16/MwsEBQNIF8eYSb3QvQ=; b=IytBtInoeqqzcOQcRsOYsoSLi7tp5wfyOx4qGYyjE4W+Q2bZEv6R1PNFqc6f3mWLsy 3DRURBuEXsLP7tibnoxe3qDGQQXD+pXkm+x8jz1/Jjl81aNSufo+0vCnrfi2WoOEl9GG qvZ6VyHlHtLHYsoMS/D3I50DlcUR6YbFsHF5CmDiqc676/a1xMT7z8aQYqH/PHJbJh1k BK6bxByZPcyjbLvHIkDMLsmuMkibL7TQGJhFId58IZwTFAAzRucl7Ht6rlvvwBgojWUO PaO8JEMlo7vmNJCppNOrACF4sqb5+2G35U5+wF7f6gmpFEt1RO53W3/dxn58LoJWkBFu YSoA== X-Gm-Message-State: AOAM532lyiwGsuyVlAEe2zOWJTVLdf0dPp2zstqv/FuavdUZf6oEZsFI 5SiDxyp7sPNLmsevgx8ysJHWbT1FfZg= X-Google-Smtp-Source: ABdhPJwPNr9+JpTH85wzlBTZpG9l60VD54q56mERGZFyjkSTTMuOuTT/VrUis1FVulrL7YOZa58KvA== X-Received: by 2002:a50:baa5:: with SMTP id x34mr5837600ede.370.1598756659280; Sat, 29 Aug 2020 20:04:19 -0700 (PDT) Received: from debian64.daheim (pd9e29952.dip0.t-ipconnect.de. [217.226.153.82]) by smtp.gmail.com with ESMTPSA id mf17sm3910625ejb.65.2020.08.29.20.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 20:04:16 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.94) (envelope-from ) id 1kCDdf-00HNUX-7N; Sun, 30 Aug 2020 05:04:15 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v1 8/8] bcm53xx: add Cisco Meraki MR32 Date: Sun, 30 Aug 2020 05:04:07 +0200 Message-Id: <059ff6adad9b3a328d4ecf17d673b98aeceaf433.1598756597.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: <86b848dda7f3d40b68ab4d1f78286b293d9f9b21.1598756597.git.chunkeey@gmail.com> <6a9a870c4f76b8cde58f28b5c77f54d8222af5e1.1598756597.git.chunkeey@gmail.com> <0e1fb52045b31e351656de541cd0188ed7c6ba93.1598756597.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200829_230421_009931_3A30B825 X-CRM114-Status: GOOD ( 37.13 ) 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:543 listed in] [list.dnswl.org] 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 NUMERIC_HTTP_ADDR URI: Uses a numeric IP address in URL -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 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 --- .../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 | 16 + .../base-files/lib/upgrade/platform.sh | 36 ++- target/linux/bcm53xx/image/Makefile | 26 ++ ...-ARM-BCM5301X-Add-DT-for-Meraki-MR32.patch | 281 ++++++++++++++++++ .../331-Meraki-MR32-Status-LEDs.patch | 28 ++ 7 files changed, 394 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..97a5e7432d 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" 102) ;; 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..d794bd0aed 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 at last, try 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..8fdc949c51 --- /dev/null +++ b/target/linux/bcm53xx/base-files/lib/preinit/07_set_preinit_iface_bcm53xx @@ -0,0 +1,16 @@ +#!/bin/sh + +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..3eb0bc9105 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,18 @@ platform_check_image() { return $error } +platform_check_image() { + case "$(board_name)" in + meraki,mr32) + error=$(nand_do_platform_check meraki-mr32 "$1") + ;; + *) + platform_other_check_image "$1" + ;; + esac +} + + # $(1): image for upgrade (with possible extra header) # $(2): offset of trx in image platform_do_upgrade_nand_trx() { @@ -393,7 +405,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 +436,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..fd8c968dba 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -320,6 +320,32 @@ define Device/luxul_xwr-3150 endef TARGET_DEVICES += luxul_xwr-3150 +define Device/meraki-mr32 + DEVICE_TITLE := Meraki MR32 + DEVICE_PACKAGES := $(B43) kmod-i2c-bcm-iproc kmod-i2c-gpio kmod-eeprom-at24 \ + kmod-leds-pwm kmod-hwmon-core 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..a59415d251 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/330-ARM-BCM5301X-Add-DT-for-Meraki-MR32.patch @@ -0,0 +1,281 @@ +From ca655714de06ebd51d0d060a4b12be9e9ac29194 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 7 Jun 2018 19:29:12 +0200 +Subject: [PATCH 4/4] 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 +--- 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,219 @@ ++// 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; ++ }; ++ }; ++}; ++ ++&i2c0 { ++ /* status = "okay"; - can be enabled once it works. */ ++ ++ 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; ++ }; ++}; ++ ++&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 = ;