From patchwork Thu Apr 18 14:16:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10907447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7AFC161F for ; Thu, 18 Apr 2019 14:18:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF35C28D21 for ; Thu, 18 Apr 2019 14:18:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD2EF28B57; Thu, 18 Apr 2019 14:18:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BC70F28CDF for ; Thu, 18 Apr 2019 14:18:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=RX48lYVymXyjsHbUP/qn9lByaZ9O0T6jxCgqNsRDG2w=; b=Z10DliczMTa5ok k7izIYg6EaYbFWtI0sHn9FYpAV0TECs4fYitRvIouJ+BJ2Cxl5gJ14UG5ULtz7W5I1BOM5pNj1+Uu dTLn3vKEn/Tul7gIj3jEjlxkDV0FG/IBEU0thZTTDCj4uFgYF2i17mYBarSpZ/CdknYvSjjoq1aoS 6ZhaF/2zx5qSokehubZSot/3N1YXe+6RY2cLkH+K+e8Rbx++yXPQbYhwQ/UtShGRumYPtgsvc2Oak aFgy34v97BvCk9WLm5clm/bTVUqAI4aMVolvcqCg48ggas3gRLUMwXxUp/64jfBmkYY6yFbZxSXH1 wdsGOFEP5mkeKyTNJFfA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hH7rU-000177-8t; Thu, 18 Apr 2019 14:18:00 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hH7rQ-00016R-Ub for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2019 14:17:58 +0000 Received: by mail-pl1-x641.google.com with SMTP id cv12so1236366plb.9 for ; Thu, 18 Apr 2019 07:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LGgAiu5VY4540GgNnynKeXs+gbdV/xnZr4APrSZdW00=; b=UJVsd9rSiqR3LBV73sq5cU+6PZPsRVK/XGS6KtpoOYEwXwztLFGB2OPhVx3ipGyvjI cL67gIjYi2wlqtHfUMw+IL6W0gV+wKFtR1011zkGDQAjwSTFgfhkVKOgtm3x5LyUJ53X JYj0wFBhlwFMpU3zoAGiWI4EYwRcHb1zYjAyU= 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=LGgAiu5VY4540GgNnynKeXs+gbdV/xnZr4APrSZdW00=; b=PFa4bHZt2dlNC8BXjyJ8imeg89nmNAPtwrt3ST+6079JedFfckqiOOxIkzKtdOrzZt jgFJYdZGolnNd9XTh4MfIB4B+hritoSC3g5V0ejiVr+NaGEyb8hnVyTpP4mk6R9riWNu PGojf9CNmTjfZ8HENyO1DOLK6rf9BxGS8zCO8nfxwSmcL1DI1zd1GBJi57F7Jcs4C9Fn 5tAN/6N6hqM3OILd6dd2O/6mBChoHBKaiHWn4rauEGhM9PrNnL/EbvRw3IGTwsYeVdxg ASpqs1ch1uFhSyK76dO9yZRMNwAbQhY0zZv3Briziozc5Bet2i1v54b6l6D5HrgkgsEs hAyA== X-Gm-Message-State: APjAAAXdk4JCJIfiklHkYbut+R+Pw+SCZlUPYoGvMxromTNTqCNg7+kJ 6G3lAAM75QHFoCXEXx6Xa0vacQ== X-Google-Smtp-Source: APXvYqxgc2FOhNQztP+Mg98lDAPl7CTxCF5gsVLGTcRUYYJXK6JypJshoIGEj7l8jL0UyeE8GQTm8g== X-Received: by 2002:a17:902:e183:: with SMTP id cd3mr79964404plb.233.1555597076157; Thu, 18 Apr 2019 07:17:56 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id q74sm6208939pfc.111.2019.04.18.07.17.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 07:17:55 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland Subject: [PATCH] arm64: dts: allwinner: a64-oceanic-5205-5inmfd: Enable CAN Date: Thu, 18 Apr 2019 19:46:58 +0530 Message-Id: <20190418141658.10868-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190418_071756_989189_47355EE9 X-CRM114-Status: GOOD ( 11.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Jagan Teki , Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Oceanic 5205 5inMFD has MCP2515 CAN device connected via SPI1. - via SPI1 bus - vdd supplied by 5V supply along with PL2 enable pin - xceiver supply same as vdd - can oscillator connected at 20MHz - PB2 gpio as interrupt pin - PD6 gpio as RX_BUF1_CAN0 - PD7 gpio as RX_BUF0_CAN0 Tested-by: Tamas Papp Signed-off-by: Jagan Teki --- .../sun50i-a64-oceanic-5205-5inmfd.dts | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts index f0cd6587f619..22535a297f51 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts @@ -21,6 +21,24 @@ chosen { stdout-path = "serial0:115200n8"; }; + + can_osc: can-osc { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <20000000>; + }; + + reg_can_v5v: reg-can-v5v { + compatible = "regulator-fixed"; + regulator-name = "reg-can-v5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + enable-active-high; + gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* CAN_3V3_EN: PL2 */ + status = "okay"; + }; + }; &ehci0 { @@ -77,6 +95,31 @@ status = "okay"; }; +&pio { + can_pins: can-pins { + pins = "PD6", /* RX_BUF1_CAN0 */ + "PD7"; /* RX_BUF0_CAN0 */ + function = "gpio_in"; + }; +}; + +&spi1 { + status = "okay"; + + can@0 { + compatible = "microchip,mcp2515"; + reg = <0>; + spi-max-frequency = <10000000>; + pinctrl-names = "default"; + pinctrl-0 = <&can_pins>; + interrupt-parent = <&pio>; + interrupts = <1 2 IRQ_TYPE_EDGE_FALLING>; /* INT_CAN0: PB2 */ + clocks = <&can_osc>; + vdd-supply = <®_can_v5v>; + xceiver-supply = <®_can_v5v>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pb_pins>;