- 05 8月, 2015 1 次提交
-
-
由 Simon Glass 提交于
At present this function does not specify its return value. Fix it. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
-
- 22 7月, 2015 2 次提交
-
-
由 Simon Glass 提交于
This parameter is named 'seq' but should be named 'of_offset'. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
In some rare cases it is useful to be able to locate a device given a device tree node offset. An example is when you have an alias that points to a node and you want to find the associated device. The device may be SPI, MMC or something else, but you don't need to know the uclass to find it. Add a function to do a global search for a device, given its device tree offset. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 23 4月, 2015 3 次提交
-
-
由 Przemyslaw Marczak 提交于
This commit extends the driver model device's API by function: - dev_get_uclass_name() And this function returns the device's uclass driver name if: - given dev pointer, is non_NULL otherwise, the NULL pointer is returned. Signed-off-by: NPrzemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: NSimon Glass <sjg@chromium.org>
-
由 Przemyslaw Marczak 提交于
This commit extends the driver model device's API by function: - dev_get_driver_ops() And this function returns the device's driver's operations if given: - dev pointer, is non-NULL - dev->driver->ops pointer, is non-NULL in other case the, the NULL pointer is returned. Signed-off-by: NPrzemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: NSimon Glass <sjg@chromium.org>
-
由 Przemyslaw Marczak 提交于
This commit adds 'uclass_platdata' field to 'struct udevice', which can be automatically allocated at bind. The allocation size is defined in 'struct uclass_driver' as 'per_device_platdata_auto_alloc_size'. New device's flag is added: DM_FLAG_ALLOC_UCLASS_PDATA, which is used for memory freeing at device unbind method. As for other udevice's fields, a complementary function is added: - dev_get_uclass_platdata() Signed-off-by: NPrzemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: NSimon Glass <sjg@chromium.org>
-
- 19 4月, 2015 4 次提交
-
-
由 Simon Glass 提交于
Add some utility functions to check for children and for the last sibling in a device's parent. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMarek Vasut <marex@denx.de>
-
由 Simon Glass 提交于
The existing get_get_of_data() function provides access to both the driver's compatible string and its driver data. However only the latter is actually useful. Update the interface to reflect this and fix up existing users. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMarek Vasut <marex@denx.de>
-
由 Simon Glass 提交于
The driver is not modified by driver model, so update driver_bind() to recognise that. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMarek Vasut <marex@denx.de>
-
由 Simon Glass 提交于
Some driver want to put DMA buffers in their private data. Add a flag to tell driver model to align driver-private data to a cache boundary so that DMA will work correctly in this case. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMarek Vasut <marex@denx.de>
-
- 17 4月, 2015 1 次提交
-
-
由 Simon Glass 提交于
Add a convenience function to access the private data that a uclass stores for each of its devices. Convert over most existing uses for consistency and to provide an example for others. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 13 2月, 2015 1 次提交
-
-
由 Peng Fan 提交于
Abstracting dev_get_addr can improve drivers that want to get device's address. Signed-off-by: NPeng Fan <Peng.Fan@freescale.com> Acked-by: NIgor Grinberg <grinberg@compulab.co.il> Acked-by: NSimon Glass <sjg@chromium.org>
-
- 30 1月, 2015 3 次提交
-
-
由 Simon Glass 提交于
This is useful to check which uclass a device is in. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
-
由 Simon Glass 提交于
Allow parent drivers to be called when a new child is bound to them. This allows a bus to set up information it needs for that child. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
-
由 Simon Glass 提交于
For buses it is common for parents to need to know the address of the child on the bus, the bus speed to use for that child, and other information. This can be provided in platform data attached to each child. Add driver model support for this, including auto-allocation which can be requested using a new property to specify the size of the data. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
-
- 22 11月, 2014 2 次提交
-
-
由 Simon Glass 提交于
Add dev_get_parent() as a convenience to obtain the parent of a device. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NTom Rini <trini@ti.com> Acked-by: NHeiko Schocher <hs@denx.de>
-
由 Simon Glass 提交于
When the device is created from a device tree node, it matches a compatible string. Allow access to that string and the associated data. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NTom Rini <trini@ti.com> Acked-by: NHeiko Schocher <hs@denx.de>
-
- 23 10月, 2014 4 次提交
-
-
由 Simon Glass 提交于
The sequence number is unique within the uclass, so state this clearly. Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
-
由 Simon Glass 提交于
Buses sometimes want to pass data to their children when they are probed. For example, a SPI bus may want to tell the slave device about the chip select it is connected to. Add a new function to permit the parent data to be supplied to the child. Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
-
由 Simon Glass 提交于
Buses need to iterate through their children in some situations. Add a few functions to make this easy. Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
-
由 Masahiro Yamada 提交于
The driver model supports two ways for passing device parameters; Device Tree and platform_data (board file). Each driver should generally support both of them because some popular IPs are used on various platforms. Assume the following scenario: - The driver Foo is used on SoC Bar and SoC Baz - The SoC Bar uses Device Tree control (CONFIG_OF_CONTROL=y) - The SoC Baz does not support Device Tree; uses a board file In this situation, the device driver Foo should work with/without the device tree control. The driver should have .of_match and .ofdata_to_platdata members for SoC Bar, while they are meaningless for SoC Baz; therefore those device-tree control code should go inside #ifdef CONFIG_OF_CONTROL. The driver code will be like this: #ifdef CONFIG_OF_CONTROL static const struct udevice_id foo_of_match = { { .compatible = "foo_driver" }, {}, } static int foo_ofdata_to_platdata(struct udevice *dev) { ... } #endif U_BOOT_DRIVER(foo_driver) = { ... .of_match = of_match_ptr(foo_of_match), .ofdata_to_platdata = of_match_ptr(foo_ofdata_to_platdata), ... } This idea has been borrowed from Linux. (In Linux, this macro is defined in include/linux/of.h) Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
- 23 7月, 2014 6 次提交
-
-
由 Simon Glass 提交于
Some devices (particularly bus devices) must track their children, knowing when a new child is added so that it can be set up for communication on the bus. Add a child_pre_probe() method to provide this feature, and a corresponding child_post_remove() method. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Some device types can have child devices and want to store information about them. For example a USB flash stick attached to a USB host controller would likely use this space. The controller can hold information about the USB state of each of its children. The data is stored attached to the child device in the 'parent_priv' member. It can be auto-allocated by dm when the child is probed. To do this, add a per_child_auto_alloc_size value to the parent driver. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Devices can have childen that can be addressed by a simple index, the sequence number or a device tree offset. Add functions to access a child in each of these ways. The index is typically used as a fallback when the sequence number is not available. For example we may use a serial UART with sequence number 0 as the console, but if no UART has sequence number 0, then we can fall back to just using the first UART (index 0). The device tree offset function is useful for buses, where they want to locate one of their children. The device tree can be scanned to find the offset of each child, and that offset can then find the device. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Fix up the style of a few comments and add/clarify a few others. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
In U-Boot it is pretty common to number devices from 0 and access them on the command line using this numbering. While it may come to pass that we will move away from this numbering, the possibility seems remote at present. Given that devices within a uclass will have an implied numbering, it makes sense to build this into driver model as a core feature. The cost is fairly small in terms of code and data space. With each uclass having numbered devices we can ask for SPI port 0 or serial port 1 and receive a single device. Devices typically request a sequence number using aliases in the device tree. These are resolved when the device is probed, to deal with conflicts. Sequence numbers need not be sequential and holes are permitted. At present there is no support for sequence numbers using static platform data. It could easily be added to 'struct driver_info' if needed, but it seems better to add features as we find a use for them, and the use of -1 to mean 'no sequence' makes the default value somewhat painful. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Driver model currently only operates after relocation is complete. In this state U-Boot typically has a small amount of memory available. In adding support for driver model prior to relocation we must try to use as little memory as possible. In addition, on some machines the memory has not be inited and/or the CPU is not running at full speed or the data cache is off. These can reduce execution performance, so the less initialisation that is done before relocation the better. An immediately-obvious improvement is to only initialise drivers which are actually going to be used before relocation. On many boards the only such driver is a serial UART, so this provides a very large potential benefit. Allow drivers to mark themselves as 'pre-reloc' which means that they will be initialised prior to relocation. This can be done either with a driver flag or with a 'dm,pre-reloc' device tree property. To support this, the various dm scanning function now take a 'pre_reloc_only' parameter which indicates that only drivers marked pre-reloc should be bound. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 21 6月, 2014 2 次提交
-
-
由 Simon Glass 提交于
There is a spelling mistake and two functions are missing comments altogether. Also the flags declaration is correct, but doesn't follow style. Finally, the uclass_get_device() function has some errors in its documentation. Fix these problems. Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NMarek Vasut <marex@denx.de>
-
由 Simon Glass 提交于
It is best to avoid having any occurence of 'struct device' in driver model, so rename to achieve this. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 27 5月, 2014 1 次提交
-
-
由 Heiko Schocher 提交于
using UBI and DM together leads in compiler error, as both define a "struct device", so rename "struct device" in include/dm/device.h to "struct udevice", as we use linux code (MTD/UBI/UBIFS some USB code,...) and cannot change the linux "struct device" Signed-off-by: NHeiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
-
- 05 3月, 2014 1 次提交
-
-
由 Simon Glass 提交于
Add driver model functionality for generic board. This includes data structures and base code for registering devices and uclasses (groups of devices with the same purpose, e.g. all I2C ports will be in the same uclass). The feature is enabled with CONFIG_DM. Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NMarek Vasut <marex@denx.de> Signed-off-by: NPavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: NViktor Křivák <viktor.krivak@gmail.com> Signed-off-by: NTomas Hlavacek <tmshlvck@gmail.com>
-