Lines Matching +full:boot +full:- +full:method

1 Driver Model Compiled-in Device Tree / Platform Data
6 ------------
8 Device tree is the standard configuration method in U-Boot. It is used to
12 The overhead of adding device tree access to U-Boot is fairly modest,
16 However there are some very constrained environments where U-Boot needs to
26 As an alternative, a new 'of-platdata' feature is provided. This converts the
37 -------
42 - Device tree does not describe data types. But the C code must define a
44 are wrong in several fairly common cases. For example an 8-byte value
45 is considered to be a 2-item integer array, and is byte-swapped. A
50 - Naming of nodes and properties is automatic. This means that they follow
54 - It is not possible to find a value given a property name. Code must use
56 the code less robust in the face of device-tree changes. It also
62 - The platform data is provided to drivers as a C structure. The driver
69 ------------
82 compatible = "rockchip,rk3288-dw-mshc";
83 clock-freq-min-max = <400000 150000000>;
86 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample";
87 fifo-depth = <0x100>;
90 bus-width = <4>;
91 cap-mmc-highspeed;
92 cap-sd-highspeed;
93 card-detect-delay = <200>;
94 disable-wp;
95 num-slots = <1>;
96 pinctrl-names = "default";
97 pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
98 vmmc-supply = <&vcc_sd>;
100 u-boot,dm-pre-reloc;
104 Some of these properties are dropped by U-Boot under control of the
149 The device is then instantiated at run-time and the platform data can be
156 platform data in the driver. The ofdata_to_platdata() method should
165 Converting of-platdata to a useful form
166 ---------------------------------------
168 Of course it would be possible use the of-platdata directly in your driver
170 driver will not be able to support device tree, since the of-platdata
175 Therefore it is recommended that the of-platdata structure should be used
176 only in the probe() method of your driver. It cannot be used in the
177 ofdata_to_platdata() method since this is not called when platform data is
182 ----------------------------
184 Drivers should always support device tree as an option. The of-platdata
185 feature is intended as a add-on to existing drivers.
187 Your driver should convert the platdata struct in its probe() method. The
189 ofdata_to_platdata() method and wrapped with #if.
193 #include <dt-structs.h>
202 * the device tree (or the C structures when of-platdata is used).
212 const void *blob = gd->fdt_blob;
215 plat->fifo_depth = fdtdec_get_int(blob, node, "fifo-depth", 0);
226 /* Decode the of-platdata from the C structures */
227 struct dtd_mmc *dtplat = &plat->dtplat;
229 plat->fifo_depth = dtplat->fifo_depth;
232 writel(plat->fifo_depth, ...)
253 the normal behaviour and is triggered by the use of of-platdata (strictly
254 speaking it is a non-zero platdata_size which triggers this).
256 The of-platdata struct contents is copied from the C structure data to the
259 ofdata_to_platdata() method should still set up the platform data (and the
260 of-platdata struct will not be present).
262 SPL must use either of-platdata or device tree. Drivers cannot use both at
263 the same time, but they must support device tree. Supporting of-platdata is
267 since the device-tree access code is not compiled in. A corollary is that
268 a board can only move to using of-platdata if all the drivers it uses support
271 there would be no code-size benefit.
274 ---------
276 The dt-structs.h file includes the generated file
277 (include/generated//dt-structs.h) if CONFIG_SPL_OF_PLATDATA is enabled.
278 Otherwise (such as in U-Boot proper) these structs are not available. This
282 The dt-platdata.c file contains the device declarations and is is built in
283 spl/dt-platdata.c.
299 -------
305 -----------
306 - Consider programmatically reading binding files instead of device tree
308 - Complete the phandle feature
309 - Move to using a full Python libfdt module
311 --