I have a prototype cape with the EEROM programmed as follows:

root@beaglebone2GB:/home/john/One-Wire# cat 
/sys/bus/i2c/devices/1-0057/eeprom | hexdump -C
00000000  aa 55 33 ee 41 30 4f 6e  65 57 69 72 65 20 70 6c  |.U3.A0OneWire 
pl|
00000010  75 73 20 43 41 4e 62 75  73 00 00 00 00 00 00 00  |us 
CANbus.......|
00000020  00 00 00 00 00 00 30 30  41 30 41 75 74 6f 41 72  
|......00A0AutoAr|
00000030  74 69 73 61 6e 73 20 49  6e 63 42 42 2d 57 31 2d  |tisans 
IncBB-W1-|
00000040  50 38 2e 31 31 00 00 00  00 00 00 00 00 00 00 00  
|P8.11...........|
00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
|................|
*
00000130  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  
|................|
*
00008000
r

Needless to say with the demise of the $SLOTS concept this tutorial is no 
longer valid so I'd like to rewrite it so it is valid.
https://www.cs.sfu.ca/CourseCentral/433/bfraser/other/2016-student-howtos/DS18B20Thermometer.pdf

Using this dts as a guide
https://github.com/beagleboard/bb.org-overlays/blob/5741f63c1ee922333dca02d9763edae03d477c96/src/arm/BB-CAN0-00A0.dts

I've modified the BB-W1-P9.12-00A0.dts to become BB-W1-P8.11-00A0.dts shown 
below.

debian@ebb:~/bb.org-overlays/src/arm$ cat BB-W1-P8.11*
/*
 * Copyright (C) 2015 Robert Nelson <[email protected]>
 *
 * Virtual cape for onewire on connector pin P8.11
 * derived from BB-W1-P9.12-00A0.dts
 *  by John Dammeyer MAR2019
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>

/ {
        compatible = "ti,beaglebone", "ti,beaglebone-black", 
"ti,beaglebone-green";

        /* identification */
        part-number = "BB-W1-P8.11";
        version = "00A0";

        /* state the resources this cape uses */
        exclusive-use =
                /* the pin header uses */
                "P8.11";

        /*
         * Free up the pins used by the cape from the pinmux helpers.
         */
        fragment@0 {
                target = <&ocp>;
                __overlay__ {
                        P8_11_pinmux { status = "disabled"; };
                };
        };

        fragment@1 {
                target = <&am33xx_pinmux>;
                __overlay__ {

                        dallas_w1_pins: pinmux_dallas_w1_pins {
                                pinctrl-single,pins = <
                                        BONE_P8_11 0x37
                                >;
                        };
                };
        };

        fragment@2 {
                target-path="/";
                __overlay__ {

                        onewire {
                                status = "okay";
                                pinctrl-names = "default";
                                pinctrl-0 = <&dallas_w1_pins>;

                                compatible = "w1-gpio";
                                gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
                        };
                };
        };
};

Next, following the document I ran ./install.sh from the 
debian@ebb:~/bb.org-overlays$ folder which ran DTS on each of the files and 
then copied them to /lib/firmware and then created a new initramfs.  With a 
few warnings.

update-initramfs: Generating /boot/initrd.img-4.14.94-ti-94
WARNING: Setting CRYPTSETUP in /etc/initramfs-tools/initramfs.conf is 
deprecated and will stop working in the future. Use 
/etc/cryptsetup-initramfs/conf-hook instead.
cryptsetup: WARNING: failed to detect canonical device of /dev/mmcblk0p1
cryptsetup: WARNING: could not determine root device from /etc/fstab
'./tools/beaglebone-universal-io/config-pin' -> 
'/usr/local/bin/config-pin'cape overlays have been built and added to 
/lib/firmware & /boot/initrd.img-4.14.94-ti-r94, please reboot

Not sure about those errors.  At this point I'm guessing the echo > $SLOTS 
isn't needed since the new dtbo is now part of the initramfs image has it 
as part of the boot process.

Plugging in the cape and starting up the beagle should theoretically then 
make a One Wire device available on pin P8.11?

If the DTS file included the definitions from the example  BB-CAN0-00A0.dts 
<https://github.com/beagleboard/bb.org-overlays/commit/5741f63c1ee922333dca02d9763edae03d477c96>
 
and the prototype board contained a CAN bus bus driver connected to P9.19, 
P9.20 would, on power up those pins then be used by the One Wire code and 
the CAN bus code?

Is the difference then that a rebuilding of the initrd image is required 
for creating custom capes?  Is there a short cut?

Am I right that this is way more difficult than the echo to $SLOTS since it 
involves a build and reboot after each edit while developing the custom 
cape dts file?  
Again, is there an easier way rather than compiling every single dts file 
with the ./install.sh script?

Thanks
John Dammeyer

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/f2e904bf-da21-4a6a-bcc4-33e7c852d394%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to