From owner-freebsd-arm@freebsd.org Fri Dec 20 08:07:24 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 477361D1C7D for ; Fri, 20 Dec 2019 08:07:24 +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 47fLvJ0z3pz4dh2; Fri, 20 Dec 2019 08:07:23 +0000 (UTC) (envelope-from nikolay.kostirya@i11.co) Received: from [82.207.42.188] (helo=localhost) by mx.i11.co with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iiDJc-0002e5-52; Fri, 20 Dec 2019 08:07:16 +0000 Date: Fri, 20 Dec 2019 10:07:13 +0200 From: Nick Kostirya To: Ian Lepore Cc: Milan Obuch , freebsd-arm@freebsd.org Subject: Re: gpioiic FDT overlays for sun8i-h3 Message-ID: <20191220100713.38c19fdb@i11.co> In-Reply-To: <78c7d14bb681f8bca11525bf61cf871c6e89c235.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> <20191129201244.0bc85b09@thinkpad> <20191219095935.6fed7431@i11.co> <78c7d14bb681f8bca11525bf61cf871c6e89c235.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: 47fLvJ0z3pz4dh2 X-Spamd-Bar: ----- X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; REPLY(-4.00)[] 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, 20 Dec 2019 08:07:24 -0000 On Thu, 19 Dec 2019 10:29:16 -0700 Ian Lepore wrote: > The gpioiic node needs to be defined at the root of the devicetree, not > under the pinctrl node. Assuming that all pins are configured as gpios > by default (they are on most SOCs) you probably don't need a pinctrl > node for them at all. If you do, someone who knows allwinner stuff > better than me would have to provide an example of that part. > > To add the gpioiic driver node using pins 0 and 2 like your example, I > think it should be just this: > > /dts-v1/; > /plugin/; > > / { > compatible = "allwinner,sun8i-h3"; > }; > > &{/} { > gpioiic@0 { > compatible = "i2c-gpio"; > scl-gpios = > <&pio 0 0 GPIO_ACTIVE_HIGH>; > sdl-gpios = <&pio 0 2 > GPIO_ACTIVE_HIGH>; > }; > > That should be enough to attach the i2c bus and the iic driver which > will give you a /dev/iic# node for userland access to the bus. If you > want to add slave devices that have kernel drivers, they get added as > child nodes within gpioiic@0, like this: > > &{/} { > gpioiic@0 { > compatible = "i2c-gpio"; > scl-gpios = <&pio 0 0 GPIO_ACTIVE_HIGH>; > sdl-gpios = <&pio 0 2 GPIO_ACTIVE_HIGH>; > > eeprom@50 { > compatible = "atmel,24c512"; > reg = <0x50>; > }; > rtc@51 { > compatible="nxp,pcf2127"; > reg = <0x51>; > }; > }; > }; > > -- Ian > It is works! Thank you very much! Nick.