From owner-freebsd-arm@freebsd.org Sun Apr 5 10:33:40 2020 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 6AA012B2810 for ; Sun, 5 Apr 2020 10:33:40 +0000 (UTC) (envelope-from mishin@mh.net.ru) Received: from frog.mh.net.ru (mh.balakovo.san.ru [88.147.158.22]) (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 48w94T3Xv3z46tF for ; Sun, 5 Apr 2020 10:33:28 +0000 (UTC) (envelope-from mishin@mh.net.ru) Received: from webmail.mh.net.ru (mouse.home [192.168.5.6]) by frog.mh.net.ru (Postfix) with ESMTPSA id 5C41914F54E for ; Sun, 5 Apr 2020 14:33:13 +0400 (+04) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 05 Apr 2020 14:33:12 +0400 From: mishin@mh.net.ru To: freebsd-arm@freebsd.org Subject: pinctrl is not working for RPI2 User-Agent: Roundcube Webmail/1.4.1 Message-ID: X-Sender: mishin@mh.net.ru X-Rspamd-Queue-Id: 48w94T3Xv3z46tF X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=mh.net.ru (policy=none); spf=fail (mx1.freebsd.org: domain of mishin@mh.net.ru does not designate 88.147.158.22 as permitted sender) smtp.mailfrom=mishin@mh.net.ru X-Spamd-Result: default: False [3.28 / 15.00]; ARC_NA(0.00)[]; R_SPF_FAIL(1.00)[-all]; SH_EMAIL_ZRD(0.00)[0.0.0.0]; RCVD_VIA_SMTP_AUTH(0.00)[]; IP_SCORE(1.05)[ipnet: 88.147.128.0/17(2.82), asn: 12389(2.41), country: RU(0.01)]; DMARC_POLICY_SOFTFAIL(0.10)[mh.net.ru : No valid SPF, No valid DKIM,none]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_DN_NONE(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.0.0.0]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM_MEDIUM(0.45)[0.451,0]; NEURAL_SPAM_LONG(0.78)[0.785,0]; FROM_NO_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12389, ipnet:88.147.128.0/17, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(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: Sun, 05 Apr 2020 10:33:40 -0000 Hi! I write a character device driver for tm1637-display and want to initialize pins for it as output pins. Now I do it by gpio_pin_setflags() from dev_attach(). But I wonder if I could do it from a fdt-overlay? For OPI PC an overlay I wrote works fine (&pio instead &gpio) but RPI2 seems to be ignoring its overlay: /dts-v1/; /plugin/; / { compatible = "brcm,bcm2836"; }; &gpio { tm1637_pins: tm1637_pins { brcm,pins = <20 21>; // GPIO20, GPIO21 brcm,function = <0x1>; // out (initially) brcm,pull = <0x0>; }; }; &{/soc} { tm1637@0 { compatible = "tm1637"; pinctrl-names = "default"; pinctrl-0 = <&tm1637_pins>; gpios = <&gpio 20 0 &gpio 21 0 >; scl = <0>; // GPIO20 (38) sda = <1>; // GPIO21 (40) status = "okay"; }; }; And after reboot "sysctl -b hw.fdt.dtb | dtc -O dts -I dtb" says: soc { ......... tm1637@0 { status = "okay"; sda = <0x1>; scl = <0x0>; gpios = <0x6 0x14 0x0 0x6 0x15 0x0>; pinctrl-0 = <0x67>; pinctrl-names = "default"; compatible = "tm1637"; }; .... skipped .... gpio@7e200000 { ....... tm1637_pins { phandle = <0x67>; brcm,pull = <0x0>; brcm,function = <0x1>; brcm,pins = <0x14 0x15>; }; But a "gpioctl -l" output reads: .... pin 20: 1 pin 20<> pin 21: 0 pin 21<> ..... What have I done wrong?