1.. SPDX-License-Identifier: GPL-2.0
2.. include:: ../disclaimer-zh_CN.rst
3
4:Original: Documentation/devicetree/overlay-notes.rst
5
6:������:
7
8 ��������� Yanteng Si <siyanteng@loongson.cn>
9
10:������:
11
12==============
13���������������������
14==============
15
16������������������drivers/of/overlay.c���������������������������������������������������
17Documentation/devicetree/dynamic-resolution-notes.rst[1]������������������
18
19������������������
20------------
21
22������������������������������������������������������������������������������������������������������������������
23������������������������������������������������������������������������������������������������������������������������
24���������������������������������������������������������������������������������������������
25
26���������������������������������������foo���������������������������������::
27
28    ---- foo.dts ---------------------------------------------------------------
29	/* FOO������ */
30	/dts-v1/;
31	/ {
32		compatible = "corp,foo";
33
34		/* ��������������� */
35		res: res {
36		};
37
38		/* ������������������������ */
39		ocp: ocp {
40			/* ��������������������������������� */
41			peripheral1 { ... };
42		};
43	};
44    ---- foo.dts ---------------------------------------------------------------
45
46������bar.dts,
47::
48
49    ---- bar.dts - ��������������������������� ----------------------------
50	/dts-v1/;
51	/������/;
52	&ocp {
53		/* bar������ */
54		bar {
55			compatible = "corp,bar";
56			... /* ������������������������ */
57		};
58	};
59    ---- bar.dts ---------------------------------------------------------------
60
61���������������������[1]���������������������������������������������foo+bar.dts::
62
63    ---- foo+bar.dts -----------------------------------------------------------
64	/* FOO������ + bar������ */
65	/ {
66		compatible = "corp,foo";
67
68		/* ������������ */
69		res: res {
70		};
71
72		/* ������������������������ */
73		ocp: ocp {
74			/* ��������������������������������� */
75			peripheral1 { ... };
76
77			/* bar������ */
78			bar {
79				compatible = "corp,bar";
80				... /* ������������������������ */
81			};
82		};
83	};
84    ---- foo+bar.dts -----------------------------------------------------------
85
86������������������������������������������������������������������bar���������������������������bar���������������
87������������������������������������������������������������������������
88
89������������DT���������-@���������������������������&ocp������������������������������������������������������
90DT���������������������������������������������������������������������������������������������������������������
91���������������������������������DT���������������������������������������������������������������������������DT������
92
93���������bar.dts���������������������������������������������������::
94
95    ---- bar.dts - ��������������������������������������� --------------------
96	/dts-v1/;
97	/������/;
98	&{/ocp} {
99		/* bar������ */
100		bar {
101			compatible = "corp,bar";
102			... /* ������������������������������ */
103		}
104	};
105    ---- bar.dts ---------------------------------------------------------------
106
107
108������������������������API
109-------------------
110
111���API���������������������
112
1131) ������of_overlay_fdt_apply()���������������������������������������������������������������
114   ������������������������������������cookie���
115
1162) ������of_overlay_remove()������������������������������������of_overlay_fdt_apply()
117   ������������������������������������������������������������������������������������������
118
119���������������������������������������������������������������������of_overlay_remove_all()���
120������������������������������������������������
121
122���������������������������������������������������������������������
123of_overlay_notifier_register/unregister���enum of_overlay_notify_action���
124
125OF_OVERLAY_PRE_APPLY���OF_OVERLAY_POST_APPLY���OF_OVERLAY_PRE_REMOVE
126������������������������������������������������������������������������������������������������������������������
127������OF_OVERLAY_POST_REMOVE������������������������OF_OVERLAY_POST_REMOVE���
128���������������������������������������������������kfree()ed���������������������OF_OVERLAY_POST_REMOVE
129������������������������������������������kfree()ed���
130
131drivers/of/dynamic.c������������������������������������������������������������������������������������
132������������������������������������������������������������������������������������������������������������������������
133���������������������������������������������������������������������������������������������������������������
134
135������������������������������������������������������������������������������������������������������������������������
136���������������������������������������������
137
138������������������������������������������������������������������������������������������������������������������������
139������������������������������������������������������������������������������������������������������������������������
140������������������������������������������������������������������������������������������������������������������������
141