From owner-freebsd-arm@freebsd.org Wed Aug 29 18:01:33 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 335C61091618 for ; Wed, 29 Aug 2018 18:01:33 +0000 (UTC) (envelope-from nmingotti@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A61417832E for ; Wed, 29 Aug 2018 18:01:32 +0000 (UTC) (envelope-from nmingotti@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id i134-v6so5102947wmf.0 for ; Wed, 29 Aug 2018 11:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=aTwi/5emv3EUqXNr9QgaKJeoifnV+qKLYrQYjypYbp0=; b=XlGSJjpjJOtiYvWkEDfTFBqnNzHXNciinxRxVBSvZwJltcHQ1oWa8A9gVSecwsSdnx pi2SJfPYHnMTUMfW/P8e/Kf7uczXGaeVj9blNW0SH7AAJ+Em71tiVAsQgi5P/Yy3+keY ZstasgfrxgUh4IuguOIj96mEwzJwkXXtq6aQ3JdB9Be/CaLhdaqZ0FfAA9YX5QK03whp zYW3sfPFvvVJqcSI0KJsRNnSfynpng1N4TfNn/gPmJDHJEcQmo21DZaa0sCpB/RH43dm QGYNx3LBAA057QuxawRJsU/revmPw3vUNQpdat5tZ5ElEH2enhuOnVj4o+/xEs9yGTd8 //1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=aTwi/5emv3EUqXNr9QgaKJeoifnV+qKLYrQYjypYbp0=; b=ozFg+30IBGSUqmAaLdqg7TTUIlJJ0MS5UYiQB3FRSWYQ/930lxXUot6AS5I72bLdAq oty9C/lk1XR5UTUrD4aCHi5DhkDrWzxOFkauiIVS147A5ApVp3RqSdC1/+aq1/JExf6o znpI6heYcLv2C6U+5Q7bCPevCLoWl89MZ6cXLoLqTNFxfL77zJx/yTC5/2s5VqFVH0Ox WNM1vtscndzBo7B8EVVR9NvIr/l6P3dcSMrDGy6esH4fs9ekpaAJYrSbpRVvRKK7eX1N 3ZJvRX5qqYRtVaO2dr95OedSsqWWjMh9b79P/iv8SpucZhGGjYy5xTWlGVDGyXfr+oS9 v/7w== X-Gm-Message-State: APzg51ASphLMqnVR8NrkP4j3N8K1k5S1kcamnPdSC1EOP87mYa4RuBpB 8p7UDNFwX+DjgzwSqFOpTCN0It4v X-Google-Smtp-Source: ANB0VdY/zNtgj4yCTkJw1BbwJNqX09nXc83073zJFNqNXbWX4zWY/aOklCQOs4gVDHyNalf9HMOT5w== X-Received: by 2002:a1c:7711:: with SMTP id t17-v6mr1027228wmi.35.1535565691127; Wed, 29 Aug 2018 11:01:31 -0700 (PDT) Received: from [172.16.0.150] (net-188-219-105-237.cust.vodafonedsl.it. [188.219.105.237]) by smtp.gmail.com with ESMTPSA id z11-v6sm3302454wrm.94.2018.08.29.11.01.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Aug 2018 11:01:30 -0700 (PDT) Subject: Re: utility for pin in BBB: PX.Y --> pin_mode, pin_name To: Russell Haley Cc: freebsd-arm References: <4661fc41-935a-56d5-2cc2-125085daf30a@gmail.com> From: Nicola Mingotti Message-ID: Date: Wed, 29 Aug 2018 20:01:28 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.27 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:01:33 -0000 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 On 08/29/18 18:26, Russell Haley wrote: > Does this help? > https://www.freebsd.org/cgi/man.cgi?gpio > > Russ > > On Wed, Aug 29, 2018 at 6:13 AM Nicola Mingotti > wrote: > > > Hi, > > I would like to know if such utility already exists, if not I > can start to program it. > > The script should work like the example below, that is, > it gives the list of all pins (starting from their physical > position on > the board), > their mode, and so their associated name/function. > > #> pinfunc > ---------------------------- > P9.1 -- > P9.2 -- > ........ > P9.21 MODE-3 ehrpwm0B > P9.22 MODE-3 ehrpwm0A > P9.23 MODE-7 gpio.1.17 > ..... > --------------------------- > > The only way i know to read the pin mode is by direct memory > access, as done in "devmem2". If you know other ways let me know. > > I saw there is "man 9 fdt_pinctrl" but it seems more for writing pin > configuration than to read it. > > bye > Nicola > > > > > > > > > > > > > > > > > -- > -------------------------- > Dr. Nicola Mingotti > R&D - Borghi Srl > CTO - BondInsider > -------------------------- > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to > "freebsd-arm-unsubscribe@freebsd.org > " > -- -------------------------- Dr. Nicola Mingotti R&D - Borghi Srl CTO - BondInsider --------------------------