Skip to content

Commit 421a523

Browse files
committed
fix: Update the how_to_check_device_tree_info guide
Fix the examples in this guide by implementing the following: - Switch from xxd to hexdump since xxd is no longer packaged in fs - Add examples and logs for am62* devices - Update code blocks to .. code-block:: console format - Make the document more generic by using <machine> for device in logs Signed-off-by: Judith Mendez <[email protected]>
1 parent 92f23db commit 421a523

File tree

1 file changed

+131
-60
lines changed

1 file changed

+131
-60
lines changed

source/linux/How_to_Guides/FAQ/How_to_Check_Device_Tree_Info.rst

Lines changed: 131 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -9,81 +9,152 @@ using the entries in /proc/device-tree.
99
In the command prompt of Linux, you should see something similar to the
1010
following in the /proc/device-tree directory:
1111

12-
::
13-
14-
root@j721e-evm:~# ls /proc/device-tree/
15-
#address-cells firmware l3-cache0
16-
#size-cells fixedregulator-evm12v0 main_r5fss_cpsw9g_virt_mac0
17-
__symbols__ fixedregulator-sd memory@80000000
18-
aliases fixedregulator-vsys3v3 model
19-
chosen fixedregulator-vsys5v0 name
20-
compatible gpio-keys pmu
21-
connector interconnect@100000 reserved-memory
22-
cpus interrupt-parent serial-number
23-
dma_buf_phys ion sound@0
24-
dummy-panel l2-cache0 timer-cl0-cpu0
12+
.. code-block:: console
13+
14+
root@j721e-evm:~# ls /proc/device-tree/
15+
#address-cells firmware l3-cache0
16+
#size-cells fixedregulator-evm12v0 main_r5fss_cpsw9g_virt_mac0
17+
__symbols__ fixedregulator-sd memory@80000000
18+
aliases fixedregulator-vsys3v3 model
19+
chosen fixedregulator-vsys5v0 name
20+
compatible gpio-keys pmu
21+
connector interconnect@100000 reserved-memory
22+
cpus interrupt-parent serial-number
23+
dma_buf_phys ion sound@0
24+
dummy-panel l2-cache0 timer-cl0-cpu0
2525
2626
Following are some typical usages you might need:
2727

28-
- Let's say you don't know the exact path of the device tree entry you are
29-
trying to check. There is a __symbol__ directory in /proc/device-tree, which
30-
is very helpful in such cases. It has an entry for each symbol label in the
31-
device tree. You can find the exact path for that symbol by running ``cat``
32-
command on that entry. Following is an example demonstrating the use:
28+
Let's say you don't know the exact path of the device tree entry you are
29+
trying to check. There is a :file:`__symbols__` directory in /proc/device-tree, which
30+
is very helpful in such cases. It has an entry for each symbol label in the
31+
device tree. You can find the exact path for that symbol by running :command:`cat`
32+
command on that entry. Following is an example demonstrating the use:
3333

34-
::
34+
.. ifconfig:: CONFIG_part_variant not in ('AM62X', 'AM62PX', 'AM62AX', 'AM64X', 'AM65X')
3535

36-
root@j721e-evm:~# cat /proc/device-tree/__symbols__/main_i2c0
37-
/interconnect@100000/i2c@2000000
36+
.. code-block:: console
3837
39-
root@j721e-evm:~# ls /proc/device-tree/interconnect@100000/i2c@2000000/
40-
#address-cells clock-names gpio@20 name pinctrl-names
41-
#size-cells clocks gpio@22 phandle power-domains
42-
clock-frequency compatible interrupts pinctrl-0 reg
38+
root@j721e-evm:~# cat /proc/device-tree/__symbols__/main_i2c0
39+
/interconnect@100000/i2c@2000000
4340
44-
- You can check the value of a device tree entry using ``cat`` command if it is a
45-
string. But if the value is an integer or some numeric data, you will have to
46-
run the ``xxd`` command instead of ``cat``, to get output in a readable format.
47-
Following is an example demonstrating the use:
41+
root@j721e-evm:~# ls /proc/device-tree/interconnect@100000/i2c@2000000/
42+
#address-cells clock-names gpio@20 name pinctrl-names
43+
#size-cells clocks gpio@22 phandle power-domains
44+
clock-frequency compatible interrupts pinctrl-0 reg
4845
49-
::
46+
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX', 'AM62AX', 'AM64X', 'AM65X')
5047

51-
# Example for a string value
52-
root@j721e-evm:~# cat /proc/device-tree/interconnect@100000/i2c@2000000/compatible
53-
ti,j721e-i2cti,omap4-i2c
48+
.. code-block:: console
5449
55-
# Example for an integer value
56-
root@j721e-evm:~# xxd -g4 /proc/device-tree/interconnect@100000/i2c@2000000/clock-frequency
57-
00000000: 00061a80 ....
50+
root@am62xx-evm:~# cat /proc/device-tree/__symbols__/main_i2c0
51+
/bus@f0000/i2c@20000000
5852
59-
# The above value is in hexadecimal. You can calculate it's value in decimal by using following command
60-
root@j721e-evm:~# echo $((0x00061a80))
61-
400000
53+
root@am62xx-evm:~# ls /proc/device-tree/bus@f0000/i2c@20000000/
54+
'#address-cells' clock-names eeprom@51 phandle power-domains tps6598x@3f
55+
'#size-cells' clocks interrupts pinctrl-0 reg
56+
clock-frequency compatible name pinctrl-names status
6257
63-
- One common scenario of a device tree change is tweaking the memory for
64-
remoteproc processors like R5F. You can check if it got updated correctly, by
65-
running a command similar to following for the specific processor core.
58+
You can check the value of a device tree entry using :command:`cat` command if it is a
59+
string. But if the value is an integer or some numeric data, you will have to
60+
run the :command:`hexdump` command instead to get output in a readable format.
61+
Following is an example demonstrating the use:
6662

67-
::
63+
.. ifconfig:: CONFIG_part_variant not in ('AM62X', 'AM62PX', 'AM62AX', 'AM64X', 'AM65X')
6864

69-
# Finding symbols for R5Fs
70-
root@j721e-evm:~# ls /proc/device-tree/__symbols__/main_r5fss*
71-
/proc/device-tree/__symbols__/main_r5fss0 /proc/device-tree/__symbols__/main_r5fss0_core1_dma_memory_region /proc/device-tree/__symbols__/main_r5fss1_core0_memory_region
72-
/proc/device-tree/__symbols__/main_r5fss0_core0 /proc/device-tree/__symbols__/main_r5fss0_core1_memory_region /proc/device-tree/__symbols__/main_r5fss1_core1
73-
/proc/device-tree/__symbols__/main_r5fss0_core0_dma_memory_region /proc/device-tree/__symbols__/main_r5fss1 /proc/device-tree/__symbols__/main_r5fss1_core1_dma_memory_region
74-
/proc/device-tree/__symbols__/main_r5fss0_core0_memory_region /proc/device-tree/__symbols__/main_r5fss1_core0 /proc/device-tree/__symbols__/main_r5fss1_core1_memory_region
75-
/proc/device-tree/__symbols__/main_r5fss0_core1 /proc/device-tree/__symbols__/main_r5fss1_core0_dma_memory_region
65+
.. code-block:: console
7666
77-
# Finding location from the symbols
78-
root@j721e-evm:~# cat /proc/device-tree/__symbols__/main_r5fss0_core0_memory_region
79-
/reserved-memory/r5f-memory@a2100000
67+
# Example for a string value
68+
root@j721e-evm:~# cat /proc/device-tree/interconnect@100000/i2c@2000000/compatible
69+
ti,j721e-i2cti,omap4-i2c
8070
81-
root@j721e-evm:~# cat /proc/device-tree/__symbols__/main_r5fss0_core0_dma_memory_region
82-
/reserved-memory/r5f-dma-memory@a2000000
71+
# Example for an integer value where the first column represents input offsets
72+
root@j721e-evm:~# hexdump -C /proc/device-tree/interconnect@100000/i2c@2000000/clock-frequency
73+
00000000 00 06 1a 80 |....|
74+
00000004
8375
84-
# Checking the values
85-
root@j721e-evm:~# xxd -g4 /proc/device-tree/reserved-memory/r5f-memory@a2100000/reg
86-
00000000: 00000000 a2100000 00000000 01f00000 ................
76+
# The above value is in hexadecimal. You can calculate it's value in decimal by using following command
77+
root@j721e-evm:~# echo $((0x00061a80))
78+
400000
8779
88-
root@j721e-evm:~# xxd -g4 /proc/device-tree/reserved-memory/r5f-dma-memory@a2000000/reg
89-
00000000: 00000000 a2000000 00000000 00100000 ................
80+
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX', 'AM62AX', 'AM64X', 'AM65X')
81+
82+
.. code-block:: console
83+
84+
# Example for a string value
85+
root@am62xx-evm:~# cat /proc/device-tree/bus@f0000/i2c@20000000/compatible
86+
ti,am64-i2cti,omap4-i2c
87+
88+
# Example for an integer value where the first column represents input offsets
89+
root@am62xx-evm:~# hexdump -C /proc/device-tree/bus@f0000/i2c@20000000/clock-frequency
90+
00000000 00 06 1a 80 |....|
91+
00000004
92+
93+
# The above value is in hexadecimal. You can calculate it's value in decimal by using following command
94+
root@am62xx-evm:~# echo $((0x00061a80))
95+
400000
96+
97+
One common scenario of a device tree change is tweaking the memory for
98+
remoteproc processors like R5F. You can check if it got updated correctly, by
99+
running a command similar to following for the specific processor core.
100+
101+
.. ifconfig:: CONFIG_part_variant not in ('AM62X', 'AM62PX', 'AM62AX', 'AM64X', 'AM65X')
102+
103+
.. code-block:: console
104+
105+
# Finding symbols for R5Fs
106+
root@j721e-evm:~# ls /proc/device-tree/__symbols__/main_r5fss*
107+
/proc/device-tree/__symbols__/main_r5fss0 /proc/device-tree/__symbols__/main_r5fss0_core1_dma_memory_region /proc/device-tree/__symbols__/main_r5fss1_core0_memory_region
108+
/proc/device-tree/__symbols__/main_r5fss0_core0 /proc/device-tree/__symbols__/main_r5fss0_core1_memory_region /proc/device-tree/__symbols__/main_r5fss1_core1
109+
/proc/device-tree/__symbols__/main_r5fss0_core0_dma_memory_region /proc/device-tree/__symbols__/main_r5fss1 /proc/device-tree/__symbols__/main_r5fss1_core1_dma_memory_region
110+
/proc/device-tree/__symbols__/main_r5fss0_core0_memory_region /proc/device-tree/__symbols__/main_r5fss1_core0 /proc/device-tree/__symbols__/main_r5fss1_core1_memory_region
111+
/proc/device-tree/__symbols__/main_r5fss0_core1 /proc/device-tree/__symbols__/main_r5fss1_core0_dma_memory_region
112+
113+
# Finding location from the symbols
114+
root@j721e-evm:~# cat /proc/device-tree/__symbols__/main_r5fss0_core0_memory_region
115+
/reserved-memory/r5f-memory@a2100000
116+
117+
root@j721e-evm:~# cat /proc/device-tree/__symbols__/main_r5fss0_core0_dma_memory_region
118+
/reserved-memory/r5f-dma-memory@a2000000
119+
120+
# Checking the values
121+
root@j721e-evm:~# hexdump -C /proc/device-tree/reserved-memory/r5f-memory@a2100000/reg
122+
00000000: 00000000 a2100000 00000000 01<address>0 ................
123+
124+
root@j721e-evm:~# hexdump -C /proc/device-tree/reserved-memory/r5f-dma-memory@a2000000/reg
125+
00000000: 00000000 a2000000 00000000 00100000 ................
126+
127+
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX', 'AM62AX', 'AM64X', 'AM65X')
128+
129+
.. code-block:: console
130+
131+
# Finding symbols for remote cores
132+
root@am62xx-evm:~# ls /proc/device-tree/__symbols__/ | grep "r5f"; ls /proc/device-tree/__symbols__/ | grep "m4f"; ls /proc/device-tree/__symbols__/ | grep "c7x";
133+
wkup_r5fss0
134+
wkup_r5fss0_core0
135+
wkup_r5fss0_core0_dma_memory_region
136+
wkup_r5fss0_core0_memory_region
137+
mcu_m4fss
138+
mcu_m4fss_dma_memory_region
139+
mcu_m4fss_memory_region
140+
141+
# Finding location from the symbols
142+
root@am62xx-evm:~# cat /proc/device-tree/__symbols__/mcu_m4fss_memory_region
143+
/reserved-memory/m4f-memory@9cc00000
144+
145+
root@am62xx-evm:~# cat /proc/device-tree/__symbols__/mcu_m4fss_dma_memory_region
146+
/reserved-memory/m4f-dma-memory@9cb00000
147+
148+
# Checking the values
149+
root@am62xx-evm:~# hexdump -C /proc/device-tree/reserved-memory/m4f-memory@9cc00000/reg
150+
00000000 00 00 00 00 9c c0 00 00 00 00 00 00 00 e0 00 00 |................|
151+
00000010
152+
153+
root@am62xx-evm:~# hexdump -C /proc/device-tree/reserved-memory/m4f-dma-memory@9cb00000/reg
154+
00000000 00 00 00 00 9c b0 00 00 00 00 00 00 00 10 00 00 |................|
155+
00000010
156+
157+
.. warning::
158+
159+
Before tweaking the memory for remote processors, please verify that the memory
160+
can be modified since some remote processors can be running firmware like DM firmware.

0 commit comments

Comments
 (0)