From owner-freebsd-arm@freebsd.org Thu Nov 28 14:20:14 2019 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0539F1AAF3C for ; Thu, 28 Nov 2019 14:20:14 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P0Cc5smnz4ck6 for ; Thu, 28 Nov 2019 14:20:12 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 5be47ec5; Thu, 28 Nov 2019 15:20:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=9eO45iFYe+qQZWZW989970ifmkc=; b=g679L5UKUZBOY6f7C2e9MgQElrHk 8lfXwJh6wye8bah7Zge8UyBhaRa05bk393Y07utwztaUKfzbQV+J7zvUonI5Ww7L Rd74jCbfSkgh/CNaZtpL/n95EnaH7zLExO0tqup+o909eo1imb9wKNMzk2fEr+U2 IRnqL3BpWWJPHlA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=EHI3A75uYXQqDyAYqICG8tyrnMTwWIJT6xCGnxtwAa8HYfw1sW2qJWiV iTUMehOQW2uNSDl/ajZTIjeges4tN+QitrxIEIqE4idV7UjtXQtStLg98Z7G76Qz EuwhfYM/ZGpLhEIdCwtIIP4H1ZhhnbdRheMMRDySx7i+9/0/Fyw= Received: from sonic.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id c9b4e71c TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 28 Nov 2019 15:20:09 +0100 (CET) Date: Thu, 28 Nov 2019 06:21:49 +0100 From: Emmanuel Vadot To: Nick Kostirya Cc: Nick Kostirya via freebsd-arm Subject: Re: gpioiic FDT overlays for sun8i-h3 Message-Id: <20191128062149.577be86eb7dc15ae5805f31a@bidouilliste.com> In-Reply-To: <20191128152901.39dbeb4d@thinkpad> References: <20191128152901.39dbeb4d@thinkpad> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47P0Cc5smnz4ck6 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=g679L5UK; dmarc=none; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-1.33 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; NEURAL_HAM_MEDIUM(-0.92)[-0.915,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bidouilliste.com]; NEURAL_HAM_LONG(-0.89)[-0.891,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.38)[ip: (-0.58), ipnet: 212.83.160.0/19(2.42), asn: 12876(0.07), country: FR(-0.00)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2019 14:20:14 -0000 On Thu, 28 Nov 2019 15:29:01 +0200 Nick Kostirya via freebsd-arm wrote: > Hello. > I want use gpioiic on Nanopi NEO with PA0 and PA2 pins. > Nanopi NEO will be master. > Help me, please, to write overlay. > I write: > > /dts-v1/; > /plugin/; > > / { > compatible = "allwinner,sun8i-h3"; > }; > > &{/soc/} { > gpio: gpio { > gpio-controller; > > gpioiic0 { > compatible = "gpioiic"; > gpios = <&gpio 00 1 0 &gpio 02 1 0>; /* Attach to GPIO pins 00 and 02. Set them initially as inputs. */ > scl = <0>; /* GPIO pin 00 (PA0) */ > sda = <1>; /* GPIO pin 02 (PA2) */ > > }; > }; > }; > > But it is not worked. > Tell me, please, where I was wrong. I've never tested gpioiic but it seems that it needs to be a child of the gpio controller as the busdev is get via device_get_parent. It also doesn't seems to use a 'gpios' property, only scl/sda pin number, which means that you can only use it on one gpio controller (i.e. you can't have scl on one gpio controller and sda on another). Try this but I haven't even compiled it : /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; }; &{/soc/pinctrl@1c20800} { gpioiic0 { compatible = "gpioiic"; scl = <0>; /* GPIO pin 00 (PA0) */ sda = <2>; /* GPIO pin 02 (PA2) */ }; }; -- Emmanuel Vadot