cboot probing

Hi,

how can I add new or modify devices slave address for cboot probe?

Trying to change properties in tegra186-quill-p3310-1000-a00-plugin-manager.dtsi doesn’t have any effect. While I change the properties like the label or slave-address I can see from recompiling dtree on the target that its dtree has changed but cboot doesn’t “see” the changes.

What is your purpose of this? I mean, you said probing in cboot, but what you modified is in plugin-manager and device tree.

Do you want to know when does those fragment in plugin-manager would take effect?

in cboot, tegrabl_eeprom_manager.c function tegrabl_eeprom_manager_init() is suposed to find node /eeprom-manager and get all the chiled nodes from eeprom-manager node.

If I change node eeprom-manager like this I don’t get the expected label from node bus1 or probed eeprom on cam bus(debug prints), even tho the dtree has changed.

/ {
	eeprom-manager {
		data-size = <0x100>;
		boardid-with-revision = <3310>;
		boardid-with-config = <3310>;
		bus@0 {
			i2c-bus = <&gen8_i2c>;
			eeprom@0 {
				slave-address = <0x50>;
				label = "cvm";
			};
			eeprom@1 {
				slave-address = <0x57>;
				label = "cvb";
			};
		};
		bus@1 {
			i2c-bus = <&gen2_i2c>;
			eeprom@0 {
				slave-address = <0x51>;
                                <b>label = "test" </b>
			};
		};
		bus@2 {
			i2c-bus = <&gen1_i2c>;
			eeprom@0 {
				slave-address = <0x50>;
			};
		};
		bus@3 {
			i2c-bus = <&cam_i2c>;
			eeprom@0 {
				<b>slave-address = <0x50>;</b>
				label = "cam";
				enable-gpio = <2 9>;
			};
		};
	};

In the end, I would like to add a device to i2c-1. But also would like to know why this is not working how it’s supposed to, and what I should do to get it working.

d.kristofic,

I can see this node “label” with content = test under /proc/devicetree and my cboot log.

[0016.019] I> wayne:tegrabl_eeprom_manager_init
[0016.027] I> Find /i2c@c250000's alias i2c7
[0016.031] I> Wayne Reading eeprom i2c=7 address=0x50 label=cvm
[0016.063] I> Device at /i2c@c250000:0x50
[0016.067] I> Wayne Reading eeprom i2c=7 address=0x57 label=cvv
[0016.097] I> Device at /i2c@c250000:0x57
[0016.102] I> Find /i2c@c240000's alias i2c1
[0016.106] I> Wayne Reading eeprom i2c=1 address=0x51 label=cvb

I change it to arbitrary label and seems work.

hi Wayne,

are you modifying tegra186-quill-p3310-1000-a00-plugin-manager.dtsi ?

I can’t see changes on my side at all. They are present in /proc/devicetree but are not parsed in cboot

My logs:
dtree on host:

eeprom-manager {
		data-size = <0x100>;
		boardid-with-revision = <3310>;
		boardid-with-config = <3310>;
		bus@0 {
			i2c-bus = <&gen8_i2c>;
			eeprom@0 {
				slave-address = <0x50>;
				label = "cvm";
			};
			eeprom@1 {
				slave-address = <0x57>;
				<b>label = "cvv";</b>
			};
		};
		bus@1 {
			i2c-bus = <&gen2_i2c>;
			eeprom@0 {
				slave-address = <0x40>;
                                <b>label = "cvb";</b>
			};
		};
		bus@2 {
			i2c-bus = <&gen1_i2c>;
			eeprom@0 {
				slave-address = <0x50>;
			};
		};
		bus@3 {
			i2c-bus = <&cam_i2c>;
			eeprom@0 {
				<b>slave-address = <0x50>;</b>
				label = "cam";
				enable-gpio = <2 9>;
			};
		};
	};

dtree on target

dtc -I fs /sys/firmware/devicetree/base > device_tree.dts
eeprom-manager {
		data-size = <0x100>;
		boardid-with-config = <0xcee>;
		boardid-with-revision = <0xcee>;

		bus@0 {
			i2c-bus = <0x8d>;

			eeprom@0 {
				slave-address = <0x50>;
				label = "cvm";
			};

			eeprom@1 {
				slave-address = <0x57>;
				<b>label = "cvv";</b>
			};
		};

		bus@1 {
			i2c-bus = <0x88>;

			eeprom@0 {
				slave-address = <0x40>;
				<b>label = "cvb";</b>
			};
		};

		bus@2 {
			i2c-bus = <0x87>;

			eeprom@0 {
				slave-address = <0x50>;
			};
		};

		bus@3 {
			i2c-bus = <0x89>;

			eeprom@0 {
				<b>slave-address = <0x50>;</b>
				label = "cam";
				enable-gpio = <0x2 0x9>;
			};
		};
	};

cboot log:

[0001.766] I> Find /i2c@c250000's alias i2c7
[0001.770] I> Reading eeprom i2c=7 address=0x50
[0001.801] I> Device at /i2c@c250000:0x50
[0001.805] I> READING            /i2c@c250000:0x50  label=cvm
[0001.809] I> Reading eeprom i2c=7 address=0x57
[0001.839] I> Device at /i2c@c250000:0x57
<b>[0001.843] I> READING            /i2c@c250000:0x57  label=cvb</b>
[0001.848] I> Find /i2c@c240000's alias i2c1
[0001.852] I> Reading eeprom i2c=1 address=0x51
[0001.857] E> i2c dev read failed
[0001.861] E> eeprom: Retry to read I2C slave device.
[0001.866] E> i2c dev read failed
[0001.869] E> eeprom: Failed to read I2C slave device
[0001.874] I> Eeprom read failed 0x1a89800d
[0001.878] I> Find /i2c@3160000's alias i2c0
[0001.882] I> Reading eeprom i2c=0 address=0x50
[0001.887] E> i2c dev read failed
[0001.890] E> eeprom: Failed to read I2C slave device
[0001.895] I> Eeprom read failed 0x1a89800d
[0001.899] I> Find /i2c@3180000's alias i2c2
[0001.903] I> Reading eeprom i2c=2 address=0x54
[0001.908] I> Enabling gpio chip_id = 2, gpio pin = 9
[0001.939] I> Disabling gpio chip_id = 2, gpio pin = 9
[0001.944] I> Device at /i2c@3180000:0x54
<b>[0001.948] I> READING            /i2c@3180000:0x54  label=cam</b>

I think it might be related to the way you flash the borad. What command were you using?

Also sorry for my previous comment. What I changed is “cvv” but not “test”.

flash device tree:

sudo ./flash.sh -k kernel-dtb jetson-tx2 mmcblk0p1

flash cboot:

sudo ./flash.sh -r -k cpu-bootloader jetson-tx2 mmcblk0p1
sudo ./flash.sh -k kernel-dtb jetson-tx2 mmcblk0p1

This command is not enough. The partition cboot uses is bootloader-dtb which is not flashed by this command.

Please use

sudo ./flash -r jetson-tx2 mmcblk0p1

Tried it, works!

Thank you Wayne.