On 29/01/14 02:25, David M. wrote:
> Consider this segment of a device tree for an I2C RTC device, such as the
> Dallas DS1307, or the DS3231 (packaged as the Chronodot, which I have).
> I've omitted most of it for clarity:
>
>
>> fragment@1 {
>> target = <&i2c2>;
>>
>> __overlay__ {
>> /* shut up DTC warnings */
>> #address-cells = <1>;
>> #size-cells = <0>;
>>
>> /* DS1307 RTC module */
>> rtc@68 {
>> compatible = "dallas,ds1307";
>> reg = <0x68>;
>> };
>> };
>> }
>>
> Note the rtc@68 address. This is ambiguous. The real address of this
> device is 0x68 in hex. The DTC parser must interpret numeric values in a
> default decimal radix, unless it has a hex digit already in it; another
> device I have is addressed as 3C, which is represented correctly.
rtc@68 is a devicetree node name, not an address as such, it's purpose is to
make the node name unique.
It's the "reg = <0x68>;" that defines the address on the i2c bus
My rtc is defined as follows
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
status = "okay";
clock-frequency = <100000>;
rtc@foobar {
compatible = "mcp,mcp7941x";
reg = <0x6f>;
};
};
it's using the same rtc-ds1307 driver and works fine.
It may be worth having a read at
Documentation/devicetree/booting-without-of.txt in the kernel source tree for
the details of how the mode names are formatted and what the "unit address"
side of the @ really means.
--
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].
For more options, visit https://groups.google.com/groups/opt_out.