This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x device tree i2c practices

I'm writing a new device tree based on am335x-evm.dts and I'm working on the I2C node right now and I had a couple questions about changes I was making:

1) I'd like to remove the wake/sleep sequences:

		i2c0: i2c@44e0b000 {
			pinctrl-names = "default";
			pinctrl-0 = <&i2c0_pins>;

			status = "okay";
			clock-frequency = <200000>;   /* 400KHz is our max, 100KHz is the processor min */

/* Set OPP50 (0.95V) for VDD core */ sleep-sequence = /bits/ 8 < 0x02 0x2d 0x25 0x1f /* Set VDD2 to 0.95V */ >; /* Set OPP100 (1.10V) for VDD core */ wake-sequence = /bits/ 8 < 0x02 0x2d 0x25 0x2b /* Set VDD2 to 1.1V */ >;

Looking at the i2c-suspend-resume.txt documentation for these parameters it appears that they are present for when the I2C goes between suspend time and resume time.

My system doesn't have any low power requirements... ie it will not be entering a sleep mode it will simply be "on" or "off". However looking at the I2C section in the TRM it talks about suspending the bus during emulation events such as debugging breakpoints.

So my question is: Are these Suspend/Resume sequences required for debug/emulation, or are they only for low power mode operation? (If the later, they are safe to remove, correct?)

 2) My design has some I2C devices which are not populated on our current design, but they do have bus addresses and could be populated in the future. In preparation for such "future enhancements" I stuck them in the device tree as such:

			rtc: rtc@51 {
				reg = <0x51>;
			};

Our external RTC will be I2C bus address 0x51, so I just put a node in there so we don't forget about it, but didn't set it "compatible" to anything. Could I get confirmation that this is a fine approach to take? It compiles, so I know syntaxly it's alright, but I just want to make sure this will not cause any logic/bus issues.

  • Hi Mike,

    I think that these are only required for low power mode suspend/resume operation and that during debug/emulation the bus will be suspended regardless of the device tree settings.

    I'd suggest you try this anyway.

    Best regards,
    Miroslav

  • Thanks for that input Miroslav we'll proceed with the sleep/wake settings removed and keep that in mind during debugging. Did you have any input on the second question about leaving "non populated" I2C devices in the tree like I have in the example there? Could you confirm if that is an issue at all?

  • Hi Mike,

    Sorry for the late reply.

    Mike Worster said:
    Did you have any input on the second question about leaving "non populated" I2C devices in the tree like I have in the example there? Could you confirm if that is an issue at all?

    No driver will be associated with these if the "compatible" field is missing from the node, so I assume there is no problem in leaving the "non-populated" I2C devices like this.

    Best regards,
    Miroslav