From owner-freebsd-arm@freebsd.org Thu Mar 30 20:42:20 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57296D2641B for ; Thu, 30 Mar 2017 20:42:20 +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 C4843667 for ; Thu, 30 Mar 2017 20:42:18 +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 b0d976a2 for ; Thu, 30 Mar 2017 22:35:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=bvYCzXTi09Sf aUAMS+4C9inVT8g=; b=DIXwqakRWhSIxjzvt0TMySuASP2/zOgum4TXZFNoFD1/ nnxNIQ1qmQxuNlYiWmNxDivd1qavdXWDWE2/u9OCImAhly1bmpAWkJWUtO6zgv5X sS1ZYqH5axwErR6ofzplisDB49rMzxKhUHBq/UX53vzXzExGEktNNk2w9ZKH1Uk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=ZXrGFM F3lCDcRnoiL2xfY9blYh9UAEuB+ILpvXKFZIzT05qISNF7HNpaZszh7NlnMez1ns MT6Cs7Aw2mQ29vkvaSnuJTD3tqcsrYjoXSVwKaRK0nlg12blgnYPqlkUE5ZJQ6wC ocPBKuXIan2enyTuvGsI+ekbF9Qa+G+CkpyLE= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id a490b61b TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO for ; Thu, 30 Mar 2017 22:35:35 +0200 (CEST) Date: Thu, 30 Mar 2017 22:35:34 +0200 From: Emmanuel Vadot To: freebsd-arm@freebsd.org Subject: Re: Enabling ADC on a Beaglebone Black running FreeBSD 12.0-CURRENT (BEAGLEBONE) Message-Id: <20170330223534.0ccc82eec0bf820651604cd7@bidouilliste.com> In-Reply-To: <20170330202858.GA22253@bluezbox.com> References: <0C4DCBB9-2642-4B0F-B15B-4139D5D8B249@obsigna.com> <271AFD8F-BD2C-445C-AB95-D7D07593E487@obsigna.com> <5D2FEB0D-64F3-488C-8458-85E7DF10EFB7@obsigna.com> <20170330202858.GA22253@bluezbox.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:42:20 -0000 On Thu, 30 Mar 2017 13:28:58 -0700 Oleksandr Tymoshenko wrote: > Dr. Rolf Jansen (rj@obsigna.com) wrote: > > Today I updated once again my Beaglebone Black by > > merging-in the latest FreeBSD 12.0-CURRENT (BEAGLEBONE) > > snapshot, and once again I enabled the ADCs on the > > Beaglebone in the device tree blob am335x-boneblack.dtb, > > and the ADC is still working fine. > > > > Even if it is not that a big hassle to modify the device > > tree blob, I am curious on why the ADC has been disabled > > in the blob in the first place, end even more, given the > > fact that the device ti_adc driver is built-in to kernel > > and once enabled, the ADC is functional. > > > > Didn't it work at some time in the past? Now it is. > > > > What is missing to activate the ADC in the device tree > > blob by default? > > Few months ago FreeBSD switched to using upstream DTB files > instead of custom-made ones. For some reason ADC is disabled > in upstream. If you're running recent FreeBSD you can use > dtb overlays to enable ADC without hassle of maintaining > custom dts file. You can do following: > > 1. Create am335x-beaglebone-tscadc.dts with following > content: > > /dts-v1/; > /plugin/; > > / { > compatible = "ti,am335x-bone-green", "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; > > fragment@0 { > target = <&tscadc>; > __overlay__ { > status = "okay"; > adc { > ti,adc-channels = <0 1 2 3 4 5 6>; > }; > }; > }; > }; > > 2. Compile overlay: > $ dtc -I dts -O dtb -o am335x-beaglebone-tscadc.dtbo am335x-beaglebone-tscadc.dts > > 3. Copy it to /boot/dtb/ directory on your BBB > > 4. Enable overlay in /boot/loader.conf by adding following line: > > fdt_overlays="am335x-beaglebone-tscadc.dtbo" > > -- > gonzo I guess that ADC uses pins that can be used for other purpose so they didn't enabled it by default ? If it's not the case they should be enable by default. Note 1 : You need to use a recent dtc (i.e. the latest dtc imported in HEAD) Note 2 : We really need to add some dtbo facility for people in the buildkernel process. -- Emmanuel Vadot