From owner-freebsd-arm@freebsd.org Wed Aug 29 18:46:23 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FC8F10922C5 for ; Wed, 29 Aug 2018 18:46:23 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0536A79DD5 for ; Wed, 29 Aug 2018 18:46:22 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: ce9ae743-abbb-11e8-ac8d-0b43254c4a2d X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id ce9ae743-abbb-11e8-ac8d-0b43254c4a2d; Wed, 29 Aug 2018 18:46:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7TIkEfH015220; Wed, 29 Aug 2018 12:46:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1535568374.33841.47.camel@freebsd.org> Subject: Re: utility for pin in BBB: PX.Y --> pin_mode, pin_name From: Ian Lepore To: Nicola Mingotti , Russell Haley Cc: freebsd-arm Date: Wed, 29 Aug 2018 12:46:14 -0600 In-Reply-To: References: <4661fc41-935a-56d5-2cc2-125085daf30a@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2018 18:46:23 -0000 On Wed, 2018-08-29 at 20:01 +0200, Nicola Mingotti wrote: > Thank you for suggestion Russel, > > but unfortunately, at best of my knowldege, > $> man 3 gpio_open > and its shell command brother > $> man 8 gpioctl > > are not appropriate, they are useful only if a pin > has been configured as GPIO pin. > > The program i look for would be useful instead to esablish > which physical pin has been configured as GPIO pin or > PWM, PRU, I2C etc. > > I asked also in the Forum, but the only one aswering > (@Phishry) has given me your same suggestion. > > If nobody knows of such a program i will start the implementation, > maybe  > tomorrow. > > bye > Nicola > Please bottom-post when replying to freebsd mailing lists. There is no interface defined for getting an fdt_pinctrl driver to return info about the current configuration. Even if such an interface existed, there would also need to be a new driver providing a cdev so that userland can access the information. There is also nothing in freebsd equivelent to the linux devmem2 program. A driver would have to be written to provide access to device- mapped memory before such a program could be written. You can't access arm hardware registers via /dev/mem or /dev/kmem. -- Ian