From owner-freebsd-current@freebsd.org Wed Dec 20 23:06:16 2017 Return-Path: Delivered-To: freebsd-current@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 17B3AE85250 for ; Wed, 20 Dec 2017 23:06:16 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0331C66AAA for ; Wed, 20 Dec 2017 23:06:16 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: by mailman.ysv.freebsd.org (Postfix) id 02710E8524F; Wed, 20 Dec 2017 23:06:16 +0000 (UTC) Delivered-To: current@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 01D0BE8524E for ; Wed, 20 Dec 2017 23:06:16 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id BB3C766AA9 for ; Wed, 20 Dec 2017 23:06:15 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id CA0C42739E for ; Wed, 20 Dec 2017 22:58:23 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id vBKMw8Tk073806 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 20 Dec 2017 22:58:08 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id vBKMw845073805; Wed, 20 Dec 2017 22:58:08 GMT (envelope-from phk) To: current@freebsd.org Subject: Re: Onewire on BeagleBoneBlack example ? In-reply-to: <97808.1513774311@critter.freebsd.dk> From: "Poul-Henning Kamp" References: <97808.1513774311@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <73803.1513810688.1@critter.freebsd.dk> Date: Wed, 20 Dec 2017 22:58:08 +0000 Message-ID: <73804.1513810688@critter.freebsd.dk> X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 23:06:16 -0000 -------- In message <97808.1513774311@critter.freebsd.dk>, Poul-Henning Kamp writes: >Does anybody have a working example of getting onewire sensors >working on beagleboneblack ? Ok, with some hints from the usual IRC channel I managed to figure it out: cd /boot/dfb mv am335x-boneblack.dtb _am335x-boneblack.dtb dtc -I dtb -O dts -o am335x-boneblack.dts _am335x-boneblack.dtb patch am335x-boneblack.dts (see below) dtc -I dts -O dtb -o am335x-boneblack.dtb am335x-boneblack.dts echo "owc_load=YES" >> /boot/loader.conf echo "ow_load=YES" >> /boot/loader.conf echo "ow_temp_load=YES" >> /boot/loader.conf The patching of am335x-boneblack.dts is black magic, but this patch worked for me: root@beaglebone:/boot/dtb # diff -u *dts --- _am335x-boneblack.dts 2017-07-21 11:24:18.229468000 +0000 +++ am335x-boneblack.dts 2017-07-21 19:19:35.166447000 +0000 @@ -2149,6 +2149,14 @@ status = "disabled"; }; + // first number (0x36, 0x4b) refers to "phandle" of gpio# + // second number is bit on that *cpu* GPIO + // not sure if the third matter, but 1 works. + onewire0 { compatible = "w1-gpio"; gpios = <0x36 30 1>; }; // P9::11 + onewire1 { compatible = "w1-gpio"; gpios = <0x36 31 1>; }; // P9::13 + onewire2 { compatible = "w1-gpio"; gpios = <0x4b 16 1>; }; // P9::15 + onewire3 { compatible = "w1-gpio"; gpios = <0x36 3 1>; }; // P9::21 + __symbols__ { l4_wkup = "/ocp/l4_wkup@44c00000"; wkup_m3 = "/ocp/l4_wkup@44c00000/wkup_m3@100000"; Either device tree overlays just plain don't work, I can't figure out how to write them (p=0.5). I sure get why getting people hooked on FreeBSD with RPi's and BeagleBones is not happening :-/ -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.