>>>>> "Koen" == Koen Kooi <
ko...@beagleboard.org> writes:
Koen> Op 17 mei 2013, om 11:04 heeft Russell Senior
Koen> <
rus...@personaltelco.net> het volgende geschreven:
>> I've spent the last few days hacking my way through a thick jungle
>> to figure out how to create a device tree or whatever I need to
>> configure one or more pins on a BeagleBoneBlack with Angstrom to
>> talk one-wire (with the w1-gpio driver, I presume). Can anyone
>> give me some hints? I'm still wrapping my head around device tree
>> (why aren't the source files included in the image? or are they?),
>> pinctl, bone_capemgr, etc.
>>
>> There don't appear to be any examples of one-wire usage in the
>> device tree source files I find in the Angstrom build tree,
>> e.g. here:
>>
>> build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/linux-mainline-3.8.13-r23a/git/arch/arm/boot/dts
Koen> firmware/capes/cape-bone-weather-00A0.dts
Okay, there's a few things I'm having trouble parsing, though they
became a lot clearer when I read the contents of:
build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/linux-mainline-3.8.13-r23a/git/Documentation/devicetree
(with the overlay discussion, in particular):
/*
* Copyright (C) 2012 Texas Instruments Incorporated -
http://www.ti.com/
*
* 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/;
/ {
compatible = "ti,beaglebone";
part-number = "BB-BONE-WTHR-01";
version = "00A0";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
weather_cape_w1_pins: pinmux_weather_cape_w1_pins {
hmm, so "weather_cape_w1_pins" is a label, and
"pinmux_weather_cape_w1_pins" is a node name. Why both? I see the
reference below (pinctrl-0). Ah, you can only reference a label, not a
name, I guess, according to Appendix A Device Tree Source Format
(version 1), in the Power_ePAPR_APPROVED_v1.1.pdf.
pinctrl-single,pins = <
0x0c 0x37 /* gpmc_ad3.gpio1_3, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE7 - w1-gpio */
I get this part, I can decode the 0x0c and 0x37 using Table 9-10 in spruh73h.pdf.
>;
};
};
};
[...]
fragment@2 {
target = <&ocp>;
__overlay__ {
onewire@0 {
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&weather_cape_w1_pins>;
status = "okay";
gpios = <&gpio2 3 0>;
What does this magic number represent? What is &gpio2 referring to?
and the 3 and 0? I now realize that gpio2 is a label to something,
but where is it defined? How do I figure out what I need for my
random pins?
};
};
};
};
Thanks!