From owner-freebsd-arm@freebsd.org Fri Nov 29 14:09:56 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 04B4E1B1A1F for ; Fri, 29 Nov 2019 14:09:56 +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 47PbxG1Spqz3xJF for ; Fri, 29 Nov 2019 14:09:53 +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 190f04bf; Fri, 29 Nov 2019 15:09:44 +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=Oy+EZ4PzUD+kPXwEVo/yY9g7YGk=; b=mwKjIAV+d+C41QKH8jg4AtNGZ5e2 B8iGj7VzfF4ZpnR42UUbaTzWbDpkBzBb47ylBkYQkRIZm6go8j6lkakDKajemVSt Ef9AjJ8KwgGosyIc9M9jWrw6fHU2zdc/QSodfxfyC2pnT6GFDXKpH0f5D+Jpe3O1 YPwD2o8wiBc7R2k= 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=iswPZkWfdFjraTsf19+BHOoWdTkQ9lBMt95cA664Xog7nGtJcbZZF03/ ne6UxdohWLr9JXukYSw8+yqy8lxsNR7oNToM4VHfFt38hOB2bYTWFmR/HO2dCbgx T+psVztoRRj9wXYDJyNpEI29EfVevpuqXHt5CGTMH/Lpu5BKO+M= Received: from skull.home.blih.net (lfbn-1-12172-130.w90-92.abo.wanadoo.fr [90.92.223.130]) by mail.blih.net (OpenSMTPD) with ESMTPSA id ba1e1c7e TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 29 Nov 2019 15:09:44 +0100 (CET) Date: Fri, 29 Nov 2019 15:09:44 +0100 From: Emmanuel Vadot To: Nick Kostirya Cc: Milan Obuch , freebsd-arm@freebsd.org Subject: Re: gpioiic FDT overlays for sun8i-h3 Message-Id: <20191129150944.67a2b723a6724c46f7559f96@bidouilliste.com> In-Reply-To: <20191129155431.05d4e14f@thinkpad> References: <20191128152901.39dbeb4d@thinkpad> <20191128062149.577be86eb7dc15ae5805f31a@bidouilliste.com> <20191129153754.28fb5763@thinkpad> <20191129144316.739c8664@zeta.dino.sk> <20191129155431.05d4e14f@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: 47PbxG1Spqz3xJF X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=mwKjIAV+; 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.31 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; 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)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.922,0]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-0.87)[-0.867,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bidouilliste.com]; TO_MATCH_ENVRCPT_SOME(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: Fri, 29 Nov 2019 14:09:56 -0000 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). > > > > > (gpioiic is name of your module in /boot/dtb/overlays)? Overlays are > > processed by loader of ours (freeBSD), not u-boot, AFAIK... > > By the way why do we need /boot/msdos/dtb/overlays/? Nope it's not needed, overlays are processed by loader(8). -- Emmanuel Vadot