iio device tree overlay

Hello,

I use a code from 2014 that utilizes cape-bone-iio-00A0.dtbo. I would like to update this code to use device tree overlays via uboot and uEnv.txt, on a 2023 linux version.

Are there any obvious conflicts this will cause with newer BBB versions? The file doesn’t show up in /lib/firmware and I am assuming there is a reason for this. I am pretty new to device trees and want to avoid unnecessary headaches.

That’s only for 3.8.x, the adc went mainline years ago as an iio device…

debian@21-am335x-bbb:/sys/bus/iio/devices/iio:device0$ uname -r
4.19.94-ti-r74
debian@21-am335x-bbb:/sys/bus/iio/devices/iio:device0$ cat in_voltage*
3919
3366
3903
2094
2112
3200
3237
3856
debian@21-am335x-bbb:/sys/bus/iio/devices/iio:device0$ cat name 
TI-am335x-adc.0.auto
1 Like

Hi Robert,

Thanks for the info. I have found that having the onboard ADC online works, and I can read voltage values like the way you demonstrate. However, I am not able to read those voltage values from the PRU with assembly code that previously worked using the $SLOTS method and the provided cape-bone-iio-00A0.dtbo. I suspect that my issue has something to do with the memory mapped ADC section:

		#address-cells = <1>;
		#size-cells = <1>;

		tscadc {
			compatible = "ti,ti-tscadc";
			reg = <0x44e0d000 0x1000>;

			interrupt-parent = <&intc>;
			interrupts = <16>;
			ti,hwmods = "adc_tsc";
			status = "okay";

			adc {
				ti,adc-channels = <0 1 2 3 4 5 6 7>;
			};
		};

But I am struggling to understand what this section does. Will this allow me to access the data from the ADC channels at the memory location 0x44e0d000? Is there something obvious I am missing? I’ve been looking at documentation but I’m still scratching my head.

Thanks for your help. These forums have allowed me to figure out a lot about the BBB already.