| Message ID | 20190418141658.10868-1-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBFMO4LSQKGQEPI4GZHI@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C844140B21 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 18 Apr 2019 16:18:01 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id f7sf1570089plr.10 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 18 Apr 2019 07:18:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1555597077; cv=pass; d=google.com; s=arc-20160816; b=R5u/4ub/Myj+Ohejs2zRF4/F+3Q5hnOo08w8BOp8WjdzzLIq7puMhm9XXu/3ylG4RP r/rCDtY0oIsxwMU0eK2e98+A/6RSHTTKXb667DsxjwPjEgYGBkXVczuXoMShkmguCBgZ OFIvrGs/CwapyL22mGMDLD/qOzultOpm00TEq7yppW2ahcSHROe/ciLCatc9EiQ4DCkH 52JMKGnXixU6ai3eHXwA04pxQjHjkiSsznt+wZcdZNeJRiV8SK+hZ/Uj1l5zTF/v25/L 2lJssTBxicS6Lrxya3b5/k+E3ZF/7Z4LoLkjapDGO/KjLWhpBbBfIFYj9ygGxzay9dlb FReg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=zxq87kXMjN0D9/FZG6t/q8xR0VY1Y7MwlSvqSOUbwsY=; b=W+rXSmAr4sBwi3Flg8KfcvjPRT7l3Im/g25PeG0EhDWU/mNZuCxqb1cPJMRawqbm5q 8QsN5VNfKH6vcawsNu7ZQlReiRlPFWlfTVdAnN1hRBGv7IGtOdIATI7zsG8yLPnmKT7X 9q6PiJmqF5xixHyQ3Q18klsw8PQBzIJnSXe0Meblr4NxhCKCXfXk9c/IIHdEsUidiAFX uH4ptYtoNq3BWwlAwjMFuykLqhXcbjfgsrXTXXtr3y7tJ+CX0h+j+hlWlveq4pD3el4n ybc/U+CIo1ctRkitDyi/Ox6z0yJDze5gNBeGeOWbgVMKiYY2+qILzGOal4m49b3WnKNl N6cw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UJVsd9rS; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=zxq87kXMjN0D9/FZG6t/q8xR0VY1Y7MwlSvqSOUbwsY=; b=qp4L+7DLIEAC13zTMzoylPiKOdgsAlG7NYEZypSDy3fyN1zEqxbCzrHfHwBirnaVTN 6VfrbRreFMr9c3Fr1rHQtLLx6JE9l9CMYgQwojhRo6GNS9kdKDDuNTkkg/ZNCWTNohlY jUac9qhuJDFuOL7na8nd0OznyT/8ICTg+2uQY= 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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=zxq87kXMjN0D9/FZG6t/q8xR0VY1Y7MwlSvqSOUbwsY=; b=tp+wS6bU3ePNRusrjeWNSRbtClPc/0/m/GH79PjWNkP9DSZd5RJTRaXtz9Rev0CxD8 z2RwhatrlH+BHWouT4gpJOWe6Ul5tV/IpaCJx0dqrYkdvineCd+0k2cjUmH85PdDUkRJ /yjrPC4Du+Yuh2OsX66qrKkhVuh9sqSyswQKFEeiif5v3E02XQQ5pHsiOniU10oeIwK4 CVEwFN61Q4RkwlluYfJ4pHHqfNicB8L+jBUMcoqwm+AtcwACxWWxnFM9+jweW5rLFMSM EA7/lZW+nAuSHj1Eo69wQediRX4PpBji7QmXxoFpBqXW9Tey2iqOXWAg/R4WyaV9zoub GuDA== X-Gm-Message-State: APjAAAXhLZ0lljmHuW6oZNBQBgDY4ikb+xsyoWW0TVTI53Bfz/whdCfW Ey9U/wCK6LwQ+eOpFSf0pFkq2w4S X-Google-Smtp-Source: APXvYqwYKM5dFQF7Mi0AtVrjU61qOQz5AC5E7kONjXXmmasxZcTyGGY5TxaDQmDpOSC/2HzUQnbbSQ== X-Received: by 2002:aa7:92d5:: with SMTP id k21mr96128321pfa.223.1555597077375; Thu, 18 Apr 2019 07:17:57 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:461d:: with SMTP id t29ls736828pfa.1.gmail; Thu, 18 Apr 2019 07:17:57 -0700 (PDT) X-Received: by 2002:a62:61c2:: with SMTP id v185mr96969775pfb.117.1555597076921; Thu, 18 Apr 2019 07:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555597076; cv=none; d=google.com; s=arc-20160816; b=YdLU3UabecQ3MWC6e7qclJRWJwZbgudEA94BcuQaFoWLAQEZX/kmSfY7R1qGQG1NwF fDpRacIshkHoaArspPqDGBut4y6uQN9n7yewXgZ4jGNgDM61C9AhhBygIVUt9G5rcL2L M4RsbaP+h0/0EnqfwkPOPobiR1rgoqpFFzT+CgpeigM8MPDbX96SecBh5TBWwrDnw8iM FeTiSMplLnhkrk7G3JEcFD+bkISLqPDEV0RUNG0ZATUCZ1Vo5qLL7NI+3yodQnyPAnPg ARzGHgLF2xWplce6haEOxiohPzO4tH/Mdm00ksHjVw0HPNrqKnc2r+7/EJC7rIWpVQ6F ZGig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=LGgAiu5VY4540GgNnynKeXs+gbdV/xnZr4APrSZdW00=; b=nGp6F1MOD2/Z7U7WCiowYU3n7sSbsSNcspNhHzc2Eh10CASiDVDJiZnUJDB1wkBQB1 eSRFJQY4MRrJusXmJ8JIHC7AQ3uYWmdKHklxmt5cHQXZ+g2XcU5yIAYQsvjdvhKlPkCW 7pNCJNJBkblfiMMlIiYiL57MyTN+PKKwjAHctj+Yehb+IEa4B+dBFSMcIpbgjnx9zOm1 Z92EmP+BHj3EAR0N53tTvSFQ4UejosrjHrTHdTVb4R9Fvdo2NlE0oIvloCDrg6BBvTgf 23zAHR6fmlem3WTA+eMgVJUmGURP3toP+9SfN47da8KBcaxMcmGCADHi4Krj9dPISIMf oGmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UJVsd9rS; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m6sor2390754pls.17.2019.04.18.07.17.56 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Thu, 18 Apr 2019 07:17:56 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; 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 <jagan@amarulasolutions.com> To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com> Cc: Michael Trimarchi <michael@amarulasolutions.com>, 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 <jagan@amarulasolutions.com> 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-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UJVsd9rS; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
arm64: dts: allwinner: a64-oceanic-5205-5inmfd: Enable CAN
|
|
Commit Message
Jagan Teki
April 18, 2019, 2:16 p.m. UTC
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 <tamas@osukl.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> --- .../sun50i-a64-oceanic-5205-5inmfd.dts | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+)
Comments
On Thu, Apr 18, 2019 at 07:46:58PM +0530, Jagan Teki wrote: > 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 <tamas@osukl.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > .../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"; You don't need the status property here. > + }; > + > }; > > &ehci0 { > @@ -77,6 +95,31 @@ > status = "okay"; > }; > > +&pio { > + can_pins: can-pins { > + pins = "PD6", /* RX_BUF1_CAN0 */ > + "PD7"; /* RX_BUF0_CAN0 */ > + function = "gpio_in"; > + }; > +}; That isn't needed. What are they used for, you're not tying them to anything? Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Maxime On Thu, Apr 18, 2019 at 4:56 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > On Thu, Apr 18, 2019 at 07:46:58PM +0530, Jagan Teki wrote: > > 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 <tamas@osukl.com> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > --- > > .../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"; > > You don't need the status property here. > Correct, need to be dropped > > + }; > > + > > }; > > > > &ehci0 { > > @@ -77,6 +95,31 @@ > > status = "okay"; > > }; > > > > +&pio { > > + can_pins: can-pins { > > + pins = "PD6", /* RX_BUF1_CAN0 */ > > + "PD7"; /* RX_BUF0_CAN0 */ > > + function = "gpio_in"; > > + }; > > +}; > > That isn't needed. What are they used for, you're not tying them to > anything? Mux of their function is correct. They are connected in the schematics but not used right now. I can garantee that kernel wlll always configurred in the right way and if I want I can export in userspace for debug purpose Michael > > Maxime > > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com -- | Michael Nazzareno Trimarchi Amarula Solutions BV | | COO - Founder Cruquiuskade 47 | | +31(0)851119172 Amsterdam 1018 AM NL | | [`as] http://www.amarulasolutions.com |
On Tue, May 21, 2019 at 08:47:02AM +0200, Michael Nazzareno Trimarchi wrote: > > > + }; > > > + > > > }; > > > > > > &ehci0 { > > > @@ -77,6 +95,31 @@ > > > status = "okay"; > > > }; > > > > > > +&pio { > > > + can_pins: can-pins { > > > + pins = "PD6", /* RX_BUF1_CAN0 */ > > > + "PD7"; /* RX_BUF0_CAN0 */ > > > + function = "gpio_in"; > > > + }; > > > +}; > > > > That isn't needed. What are they used for, you're not tying them to > > anything? > > Mux of their function is correct. They are connected in the schematics > but not used right now. Then describe the whole thing or don't? And that's kind of missing my point. If that pin group isn't related to any device, the pin muxing will not be changed. So that group, in itself, has strictly no effect. Moreover, you don't need a pin group in the first place to mux pins in GPIOs, the GPIO API will make sure that is the case when you request it. > I can garantee that kernel wlll always configurred in the right way > and if I want I can export in userspace > for debug purpose Yes, because the API does it, not your change Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Maxime On Tue, May 21, 2019 at 10:10 AM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > On Tue, May 21, 2019 at 08:47:02AM +0200, Michael Nazzareno Trimarchi wrote: > > > > + }; > > > > + > > > > }; > > > > > > > > &ehci0 { > > > > @@ -77,6 +95,31 @@ > > > > status = "okay"; > > > > }; > > > > > > > > +&pio { > > > > + can_pins: can-pins { > > > > + pins = "PD6", /* RX_BUF1_CAN0 */ > > > > + "PD7"; /* RX_BUF0_CAN0 */ > > > > + function = "gpio_in"; > > > > + }; > > > > +}; > > > > > > That isn't needed. What are they used for, you're not tying them to > > > anything? > > > > Mux of their function is correct. They are connected in the schematics > > but not used right now. > > Then describe the whole thing or don't? > Ok > And that's kind of missing my point. If that pin group isn't related > to any device, the pin muxing will not be changed. So that group, in > itself, has strictly no effect. > > Moreover, you don't need a pin group in the first place to mux pins in > GPIOs, the GPIO API will make sure that is the case when you request > it. This is correct on sunxi. Is this valid for sunxi or in general in all the SoC? Anyway make sense to have pins configured and place in the right state, just suppose if the booting stage is wrong or anything that make those pins in the wrong configuration > > > I can garantee that kernel wlll always configurred in the right way > > and if I want I can export in userspace > > for debug purpose Correct if you start to use it but if you want them right configured the right place is in the default state e/o initstate if this can be a problem of the hardware Default state: the state the pinctrl handle shall be put * into as default, usually this means the pins are up and ready to * be used by the device driver. This state is commonly used by * hogs to configure muxing and pins at boot, and also as a state * to go into when returning from sleep and idle in * .pm_runtime_resume() or ordinary .resume() for example. Now the pins are connected to the canbus as should be and they are configured and usually put in the right state. + compatible = "microchip,mcp2515"; + reg = <0>; + spi-max-frequency = <10000000>; + pinctrl-names = "default"; + pinctrl-0 = <&can_pins>; > > Yes, because the API does it, not your change > Do you prefer to drop the pinmux? or update the commit message > Maxime > > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com
Hi Michael, On Tue, May 21, 2019 at 01:08:09PM +0200, Michael Nazzareno Trimarchi wrote: > On Tue, May 21, 2019 at 10:10 AM Maxime Ripard > <maxime.ripard@bootlin.com> wrote: > > > > On Tue, May 21, 2019 at 08:47:02AM +0200, Michael Nazzareno Trimarchi wrote: > > > > > + }; > > > > > + > > > > > }; > > > > > > > > > > &ehci0 { > > > > > @@ -77,6 +95,31 @@ > > > > > status = "okay"; > > > > > }; > > > > > > > > > > +&pio { > > > > > + can_pins: can-pins { > > > > > + pins = "PD6", /* RX_BUF1_CAN0 */ > > > > > + "PD7"; /* RX_BUF0_CAN0 */ > > > > > + function = "gpio_in"; > > > > > + }; > > > > > +}; > > > > > > > > That isn't needed. What are they used for, you're not tying them to > > > > anything? > > > > > > Mux of their function is correct. They are connected in the schematics > > > but not used right now. > > > > Then describe the whole thing or don't? > > > > Ok > > > And that's kind of missing my point. If that pin group isn't related > > to any device, the pin muxing will not be changed. So that group, in > > itself, has strictly no effect. > > > > Moreover, you don't need a pin group in the first place to mux pins in > > GPIOs, the GPIO API will make sure that is the case when you request > > it. > > This is correct on sunxi. Is this valid for sunxi or in general in > all the SoC? IIRC, it happens on all the SoCs that have a shared GPIO/pinctrl driver. > Anyway make sense to have pins configured and place in the right > state, just suppose if the booting stage is wrong or anything that > make those pins in the wrong configuration It would be a bug in the pinctrl / GPIO code that would need to be fixed. > > > > > I can garantee that kernel wlll always configurred in the right way > > > and if I want I can export in userspace > > > for debug purpose > > Correct if you start to use it but if you want them right configured > the right place is in the default state e/o initstate if this can be > a problem of the hardware What problem do you have exactly? > Default state: the state the pinctrl handle shall be put > * into as default, usually this means the pins are up and ready to > * be used by the device driver. This state is commonly used by > * hogs to configure muxing and pins at boot, and also as a state > * to go into when returning from sleep and idle in > * .pm_runtime_resume() or ordinary .resume() for example. > > Now the pins are connected to the canbus as should be and they are > configured and usually put in the right state. As soon as you call gpio_get, the pins will be configured properly. And, pinctrl shouldn't allow that configuration (gpio_get + a pinctrl node for GPIOs) in our case. We do on most SoCs (all but the H6) for historical reasons, but this creates other bugs that we can't really fix right now. Still, we're slowly removing all of those pinctrl nodes, so it's not really to add new ones. > + compatible = "microchip,mcp2515"; > + reg = <0>; > + spi-max-frequency = <10000000>; > + pinctrl-names = "default"; > + pinctrl-0 = <&can_pins>; > > > > > Yes, because the API does it, not your change > > Do you prefer to drop the pinmux? or update the commit message Drop the pinctrl group Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
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>;