beagleboard / linux

The official Read Only BeagleBoard and BeagleBone kernel repository https://git.beagleboard.org/beagleboard/linux
http://beagleboard.org/source
Other
725 stars 563 forks source link

1-wire overlay in BBG, Debian, Kernel 4.14 #202

Closed JeanAnouilh closed 5 years ago

JeanAnouilh commented 5 years ago

Hello Everybody,

I want to enable e specific pin to be used as a 1-wire bus, but everything I've tried didn't work. There were neither errors nor was there ever any device in /sys/bus/w1/devices/.

Here are some information about the system I use:

The output from sudo /opt/scripts/tools/version.sh:
git:/opt/scripts/:[e9bcff232834702c1c810710706ee815d77b080b]
eeprom:[A335BNLTBBG1BBG116045614]
model:[TI_AM335x_BeagleBone_Green]
dogtag:[BeagleBoard.org Debian Image 2018-10-14]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.09-00002-gd5b4c4b656]:[location: dd MBR]
kernel:[4.14.71-ti-r80]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr1=/lib/firmware/BB-UART2-00A0.dtbo]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[disable_uboot_overlay_wireless=1]
uboot_overlay_options:[disable_uboot_overlay_adc=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/BB-PPS-P9_12-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-W1-P8.11-00A0.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.4.20190404.0-0rcnee0~stretch+20190404]
pkg:[bb-wl18xx-firmware]:[1.20190227.1-0rcnee0~stretch+20190227]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20180825+dfsg-1rcnee1~stretch+20181217]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal netdev gpio pwm eqep admin spi i2c tisdk weston-launch xenomai bluetooth cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[    1.119468] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[    1.131469] gpio-of-helper ocp:cape-universal: ready
END

Here you see my uEnv.txt: uEnv.txt

This is the .dts file I've used: BB-W1-P8.11-00A0.dts.txt

And here is the output from dmesg: dmesg.txt

I really don't know what I'm doing wrong that it's not working.

Thanks for any help.

RobertCNelson commented 5 years ago

@JeanAnouilh onewire isn't under ocp:

    fragment@1 {
        target = <&ocp>;
        __overlay__ {
            onewire@0 {

It's under /

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-W1-P9.12-00A0.dts#L53

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

            onewire {

Regards,

JeanAnouilh commented 5 years ago

@RobertCNelson Thanks a lot, but now I'm getting this error: Error: w1.dts:16.1-9 syntax error FATAL ERROR: Unable to parse input tree

when I use: dtc -O dtb -o w1-00A0.dtbo -b 0 -@ w1.dts

When I remove the #include lines and replace some parts with hardcode the compilation works, but then again I don't see a device in /sys/bus/w1/devices/. w1.dts.txt

RobertCNelson commented 5 years ago

@JeanAnouilh

when I use: dtc -O dtb -o w1-00A0.dtbo -b 0 -@ w1.dts

Sorry, I'm not going to debug that, stick the file under ./src/arm/ and run make..

When I remove the #include lines and replace some parts with hardcode the compilation works, but then again I don't see a device in /sys/bus/w1/devices/. w1.dts.txt

github says: "Not Found"

see example:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-W1-P9.12-00A0.dts

Regards,

JeanAnouilh commented 5 years ago

Sorry, I'm not going to debug that, stick the file under ./src/arm/ and run make..

You don't have to be sorry, I didn't expect that. But thanks for the hint with make, this perfectly worked. That was all I was missing the entire time.