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; ++ }; ++};