Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp676159yba; Thu, 18 Apr 2019 07:49:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1d3/qTOR9rZ9tf7LCke1yJBEyhDmiCbkLb3rvjXgMMkDDWNp4nPBlldwYO9zhwXsEEbkb X-Received: by 2002:a63:c45:: with SMTP id 5mr89898855pgm.385.1555598955265; Thu, 18 Apr 2019 07:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555598955; cv=none; d=google.com; s=arc-20160816; b=YviSMpjXr6be5MqnlWfC6WNdvyRlr/R8KnnlGnJ2/HgmCgq/BgjfH+fI3FLapEHvJW oSajQADUk/W+S+XKbLl4iDGiqu4cNohzJWGS9I/UI5LUYkCg7A9jc0wgSyorxuMiVsPt jYD36T4NHxSnWYS6+lBak4v9fVAkJOXDTJUlDt/whYf9fbyY7hJvUNh0czLQ7RvvwKll GXJKoba/VTMLgBtQoK0v5SgPm0BShy5Wzhi/cKPVlZbx8+y4moX24nq3YEH7dTj06q56 EnUOsVFkz71BPr8oVvprzAxyMvnyTMsuQ8qnkFyjJznldt5wXQ10QtQ7qNgGmc9TrAsv 8MKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LGgAiu5VY4540GgNnynKeXs+gbdV/xnZr4APrSZdW00=; b=COWXI1j/wJ/iM2wrQNWCOGvi2CVB26P3wglHK8TCK201+JINq7tHOpvVWrH7YFq9DT 7gT0hLfn0wY99T6DWCiPpDX0Gvz5sgfzrIl6WwFNFALo5s8tfnzz4EPD3MSVRU8Pb10X W+OlEmKzl9kRksugc5Mbul7RxyottzM5NwLxLIrNdDwTaH7gRO5WDEPcwuWtHB8aXIHC Kw1AuaolvOotAIJRkgOWpz0/twWXPf0CkhgG/sHR9DMUXsK20Xf/5G6f3QUAtPJHzNCY /fYaco7tRNZZvmp+utf2dZlQiRyclMWxzyPssO1aPOZRZVyOReK1sk3DN68YnOwVp4a+ b17w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UJVsd9rS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18si2094508pgj.188.2019.04.18.07.49.00; Thu, 18 Apr 2019 07:49:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UJVsd9rS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389292AbfDROR6 (ORCPT + 99 others); Thu, 18 Apr 2019 10:17:58 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45181 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389209AbfDROR5 (ORCPT ); Thu, 18 Apr 2019 10:17:57 -0400 Received: by mail-pl1-f196.google.com with SMTP id bf11so1232051plb.12 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=mIsPo8hTaDkF0pEhak9ifQdbjqsG84+2K7qqsYkgCKzAOQpJ2K79abicTlR00JojaV NofMIlvICw6GkfpviTPON6e+mG183ubbJj3yjGGPeY8IIek3ZFbxrtrJXlHvrO3KtEoX FdRu5Fw8YwZuQP/O6xhpXleD+Ng7UPh3WVlO97OBn1pFsgQyc0rT3CaQNT+mqAndu/wt rj77k8UMmbEUWHIppomeicKHMQp/0kwjyhj0fgkTYwKzug+gOG44BIjBOGM9j6C0I61D dn1O10Q1zXtc+TkbPziw2/JZwqVy53lw6zLwnEk7zbDkiRD2gBZWMOzOvQWvBleieWDC lJOw== X-Gm-Message-State: APjAAAVJdSu/7RrpvhhkEntXvk12vVQklWX43QVtaGwnEwv2A7L5kGzM Nyg6u+6/Ws/nq41MY/OBDc7bAA== 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 Cc: Michael Trimarchi , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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>; -- 2.18.0.321.gffc6fa0e3