From owner-freebsd-arm@freebsd.org Fri Nov 29 18:12:49 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 69C9D1B7EA4 for ; Fri, 29 Nov 2019 18:12:49 +0000 (UTC) (envelope-from nikolay.kostirya@i11.co) Received: from mx.i11.co (mx.i11.co [159.69.78.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47PjKY2BvYz49s3; Fri, 29 Nov 2019 18:12:48 +0000 (UTC) (envelope-from nikolay.kostirya@i11.co) Received: from [178.93.41.70] (helo=thinkpad) by mx.i11.co with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iakl5-0007dc-6K; Fri, 29 Nov 2019 18:12:47 +0000 Date: Fri, 29 Nov 2019 20:12:44 +0200 From: Nick Kostirya To: Ian Lepore Cc: Emmanuel Vadot , Milan Obuch , freebsd-arm@freebsd.org Subject: Re: gpioiic FDT overlays for sun8i-h3 Message-ID: <20191129201244.0bc85b09@thinkpad> In-Reply-To: <0ce78262af1dd3b404b9a85a780933d7e11f008e.camel@freebsd.org> References: <20191128152901.39dbeb4d@thinkpad> <20191128062149.577be86eb7dc15ae5805f31a@bidouilliste.com> <20191129153754.28fb5763@thinkpad> <20191129144316.739c8664@zeta.dino.sk> <20191129155431.05d4e14f@thinkpad> <20191129150944.67a2b723a6724c46f7559f96@bidouilliste.com> <0ce78262af1dd3b404b9a85a780933d7e11f008e.camel@freebsd.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i386-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47PjKY2BvYz49s3 X-Spamd-Bar: ----- X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0] 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: Fri, 29 Nov 2019 18:12:49 -0000 On Fri, 29 Nov 2019 09:23:31 -0700 Ian Lepore wrote: > On Fri, 2019-11-29 at 15:09 +0100, Emmanuel Vadot wrote: > > On Fri, 29 Nov 2019 15:54:31 +0200 > > Nick Kostirya wrote: > > > > > From: Nick Kostirya > > > To: Milan Obuch > > > Subject: Re: gpioiic FDT overlays for sun8i-h3 > > > Date: Fri, 29 Nov 2019 15:53:05 +0200 > > > X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i386-portbld-freebsd12.0) > > > > > > On Fri, 29 Nov 2019 14:43:16 +0100 > > > Milan Obuch wrote: > > > > > > > On Fri, 29 Nov 2019 15:37:54 +0200 > > > > Nick Kostirya via freebsd-arm wrote: > > > > > > > > > On Thu, 28 Nov 2019 06:21:49 +0100 > > > > > Emmanuel Vadot wrote: > > > > > > > > > > > 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) */ > > > > > > > > > > > > }; > > > > > > }; > > > > > > > > > > Maybe I must rebuild all u-boot with this overlay? > > > > > > > > > > Because the overlay do not help when it is in /boot/dtb/overlays/ and > > > > > /boot/msdos/dtb/overlays/. > > > > > > > > > > > > > Did you add in /boot/loader.conf line like > > > > > > > > fdt_overlays="gpioiic" > > > > > > Yes. > > > I have > > > fdt_overlays="sun8i-h3-sid,sun8i-h3-ths,sun8i-h3-opp,sun8i-h3-gpio-iic0" > > > > > > where sun8i-h3-gpio-iic0 if gpioiic overlay. > > > > > > I see gpioiic in ofwdump -a output. > > > > Which means that the overlays was applied. > > I've spent a few hours yesterday to find how to use this module and > > the result is we can't. The reason is that the driver is at an higher > > bus pass number than the parent (gpiobus) so the driver isn't probed > > and is removed from the child list of gpiobus, meaning that it's never > > added later. > > ian@ and I agreed that it the driver would need to be rewritten > > because of this and because you cannot use gpio from different banks as > > it needs to be a children of one gpio controller. > > So the TLDR is : right now this driver is useless (at least on FDT > > system). > > I am working on this, though. I'm thinking we should have something > usable later today, or at worst by the end of the weekend if it turns > complicated. > > -- Ian Thank you very match!!! I hope the new driver can be used in FreeBSD 12. Nick.