Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Mar 2017 18:11:33 -0300
From:      "Dr. Rolf Jansen" <rj@obsigna.com>
To:        freebsd-arm@FreeBSD.org
Subject:   Re: Enabling ADC on a Beaglebone Black running FreeBSD 12.0-CURRENT (BEAGLEBONE)
Message-ID:  <79EE9798-BCF0-4585-93F5-4E604142561F@obsigna.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>

next in thread | previous in thread | raw e-mail | index | archive | help
Am 30.03.2017 um 17:28 schrieb Oleksandr Tymoshenko =
<gonzo@bluezbox.com>:
> 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.
>>=20
>> 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.
>>=20
>> Didn't it work at some time in the past? Now it is.
>>=20
>> What is missing to activate the ADC in the device tree
>> blob by default?
>=20
> 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:
>=20
> 1. Create am335x-beaglebone-tscadc.dts with following
> content:
>=20
> /dts-v1/;
> /plugin/;
>=20
> / {
>    compatible =3D "ti,am335x-bone-green", "ti,am335x-bone-black", =
"ti,am335x-bone", "ti,am33xx";
>=20
>    fragment@0 {
>        target =3D <&tscadc>;
>        __overlay__ {
>            status =3D "okay";
>            adc {
>                ti,adc-channels =3D <0 1 2 3 4 5 6>;
>            };
>        };
>    };
> };
>=20
> 2. Compile overlay:
>  $ dtc -I dts -O dtb -o am335x-beaglebone-tscadc.dtbo =
am335x-beaglebone-tscadc.dts
>=20
> 3. Copy it to /boot/dtb/ directory on your BBB
>=20
> 4. Enable overlay in /boot/loader.conf by adding following line:
>=20
> fdt_overlays=3D"am335x-beaglebone-tscadc.dtbo"


Oleksandr, thank you very much for drawing my attention to the dtb =
overlay facility.

I created and enabled the adc-dtb-overlay file as you explained above, =
and it works.

Best regards

Rolf




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?79EE9798-BCF0-4585-93F5-4E604142561F>